/* =============================================
   css/style.css — Global Shared Styles
   WhisperWall Confession App
   ============================================= */

/* ── CSS Variables ── */
:root {
  --bg-deep:      #0a0910;
  --bg-mid:       #110f1a;
  --bg-card:      #16131f;
  --bg-card2:     #1c1828;
  --accent:       #c97d4e;
  --accent-glow:  #c97d4e44;
  --accent2:      #7c5cbf;
  --accent2-glow: #7c5cbf44;
  --text-primary: #f0eae0;
  --text-muted:   #8a7f9a;
  --text-faint:   #4a4458;
  --border:       #2a2438;
  --border-hover: #3d3560;
  --red:          #e05e5e;
  --green:        #5ec98b;
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    22px;
  --shadow-card:  0 8px 40px rgba(0,0,0,0.5);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated Background ── */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb1 { width: 600px; height: 600px; background: var(--accent2); top: -200px; left: -150px; animation-delay: 0s; }
.orb2 { width: 500px; height: 500px; background: var(--accent);  bottom: -100px; right: -100px; animation-delay: -6s; }
.orb3 { width: 350px; height: 350px; background: #3b2060; top: 40%; left: 40%; animation-delay: -12s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.08); }
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 1;
}

/* ── Utility ── */
.hidden { display: none !important; }
.highlight { color: var(--accent); font-style: italic; }

/* ── Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.field label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field textarea,
.field select {
  background: var(--bg-deep);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field textarea { resize: vertical; min-height: 120px; }

.field-error {
  color: var(--red);
  font-size: 0.8rem;
  min-height: 16px;
}

/* ── Buttons ── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #a0622e 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 14px 24px;
  width: 100%;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  box-shadow: 0 4px 20px rgba(201,125,78,0.35);
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(201,125,78,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card2);
  border: 1px solid var(--border-hover);
  border-radius: 40px;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 12px 28px;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  box-shadow: var(--shadow-card);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

/* ── Optional badge ── */
.optional { color: var(--text-faint); font-size: 0.75rem; text-transform: none; letter-spacing: 0; }
