/* ============================================================
   B'dayBuzz — style.css
   Complete stylesheet for all layouts and pages
   ============================================================ */

/* ── 1. RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--accent);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { line-height: 1.2; }

/* ── 2. CSS VARIABLES ────────────────────────────────────── */
:root {
  /* Brand colours */
  --primary:        #FBBF24;   /* amber-400  */
  --primary-dark:   #D97706;   /* amber-600  */
  --primary-pale:   #FEF3C7;   /* amber-50   */

  /* Neutrals */
  --accent:         #1C1917;   /* stone-900  */
  --accent-soft:    #44403C;   /* stone-700  */
  --white:          #FFFFFF;
  --bg:             #F9FAFB;

  --gray-50:        #F9FAFB;
  --gray-100:       #F3F4F6;
  --gray-200:       #E5E7EB;
  --gray-300:       #D1D5DB;
  --gray-400:       #9CA3AF;
  --gray-500:       #6B7280;
  --gray-600:       #4B5563;
  --gray-700:       #374151;
  --gray-800:       #1F2937;

  /* Semantic */
  --success:        #16A34A;
  --success-light:  #DCFCE7;
  --error:          #DC2626;
  --error-light:    #FEE2E2;
  --warning:        #D97706;
  --warning-light:  #FEF3C7;
  --info:           #2563EB;
  --info-light:     #DBEAFE;

  /* Radii */
  --radius:         0.5rem;
  --radius-md:      0.75rem;
  --radius-lg:      1rem;
  --radius-full:    9999px;

  /* Shadows */
  --shadow-sm:      0 1px 2px 0 rgba(0,0,0,.05);
  --shadow:         0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-md:      0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-lg:      0 20px 25px -5px rgba(0,0,0,.1),  0 8px 10px -6px rgba(0,0,0,.05);

  /* Transition */
  --transition:     150ms ease;

  /* Typography */
  --font-display:   'Plus Jakarta Sans', sans-serif;
  --font-body:      'Inter Tight', sans-serif;

  /* Layout */
  --sidebar-w:      256px;
}

/* ── 3. APP LAYOUT (authenticated) ──────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.75rem;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.25rem;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  padding: 0 0.5rem;
  margin-bottom: 0.375rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.625rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 0.125rem;
}

.sidebar-link:hover {
  background: var(--gray-100);
  color: var(--accent);
}

.sidebar-link.active {
  background: var(--primary-pale);
  color: var(--primary-dark);
  font-weight: 600;
}

.sidebar-link.active .sidebar-icon {
  stroke: var(--primary-dark);
}

.sidebar-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: var(--gray-400);
  transition: stroke var(--transition);
}

.sidebar-link:hover .sidebar-icon {
  stroke: var(--accent);
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--gray-100);
  flex-shrink: 0;
}

/* Main content area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.page-body {
  flex: 1;
}

/* ── 4. GUEST LAYOUT (auth pages) ────────────────────────── */
.guest-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left brand panel */
.guest-brand-panel {
  background: var(--accent);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.guest-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 80%, rgba(251,191,36,.18) 0%, transparent 70%),
              radial-gradient(ellipse 50% 50% at 80% 20%, rgba(251,191,36,.10) 0%, transparent 70%);
  pointer-events: none;
}

.guest-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  position: relative;
  z-index: 1;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
}

.guest-brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.guest-brand-hero {
  position: relative;
  z-index: 1;
}

.guest-brand-heading {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.25rem;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.guest-brand-highlight {
  color: var(--primary);
}

.guest-brand-sub {
  color: rgba(255,255,255,0.55);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 340px;
  margin-bottom: 2rem;
}

.guest-brand-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest-brand-feature {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.guest-brand-feature-icon {
  width: 30px;
  height: 30px;
  background: rgba(251,191,36,.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.guest-brand-feature-text {
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
}

.guest-brand-footer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
  position: relative;
  z-index: 1;
}

/* Right form panel */
.guest-form-panel {
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  overflow-y: auto;
  min-height: 100vh;
}

.guest-form-inner {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.mobile-logo {
  display: none;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

/* ── 5. BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4375rem;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  border: 1.5px solid transparent;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: var(--accent);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(251,191,36,.35);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--accent);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--gray-200);
}
.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

.btn-block {
  width: 100%;
}

/* ── 6. CARDS ────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--accent);
}

.card-body {
  padding: 1.5rem;
}

/* ── 7. STATS GRID ───────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ── 8. FORMS ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--accent);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  line-height: 1.5;
}

.form-control::placeholder { color: var(--gray-400); }

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(251,191,36,.18);
}

.form-control.is-invalid {
  border-color: var(--error);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.form-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.required {
  color: var(--error);
  font-weight: 700;
}

/* Input group (icon + input) */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .form-control {
  padding-left: 2.375rem;
}

.input-group .form-control:last-child:not(:only-child) {
  padding-right: 2.5rem;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--gray-400);
  pointer-events: none;
  flex-shrink: 0;
}

.input-group-append {
  position: absolute;
  right: 0.75rem;
  display: flex;
  align-items: center;
}

/* ── 9. AUTH COMPONENTS ──────────────────────────────────── */
.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.6875rem 1rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
              box-shadow var(--transition);
  font-family: var(--font-body);
}

.auth-social-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 1.25rem 0;
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── 10. MOBILE RESPONSIVENESS ───────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Sidebar collapses off-screen on mobile */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Main content fills full width */
  .main-content {
    margin-left: 0;
  }

  /* Dashboard two-col grid goes single column */
  .page-body > div > div[style*="grid-template-columns:1fr 360px"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Guest layout stacks vertically */
  .guest-layout {
    grid-template-columns: 1fr;
  }

  .guest-brand-panel {
    display: none;
  }

  .guest-form-panel {
    padding: 2rem 1.25rem;
    justify-content: flex-start;
    padding-top: 2.5rem;
  }

  .mobile-logo {
    display: flex !important;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .guest-form-panel {
    padding: 1.5rem 1rem;
  }
}

/* ── 11. UTILITIES ───────────────────────────────────────── */
.mobile-menu-toggle { display: none; }

@media (max-width: 768px) {
  .mobile-menu-toggle { display: flex !important; }
}

/* ── ROLE CARDS ─────────────────────────────────────── */
.role-card {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.875rem;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  background: var(--white);
  user-select: none;
}
.role-card:hover {
  border-color: var(--primary);
  background: var(--primary-pale);
}
.role-card--active {
  border-color: var(--primary);
  background: var(--primary-pale);
  box-shadow: 0 0 0 3px rgba(251,191,36,.18);
}

/* ── WIZARD ─────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 1rem 0.5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
}
.wizard-step-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  font-family: var(--font-display);
}
.wizard-step-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-400);
  text-align: center;
  transition: color var(--transition);
  white-space: nowrap;
}
.wizard-step.active .wizard-step-bubble {
  background: var(--primary);
  color: var(--accent);
}
.wizard-step.active .wizard-step-label {
  color: var(--accent);
}
.wizard-step.completed .wizard-step-bubble {
  background: var(--success);
  color: var(--white);
  font-size: 0;
}
.wizard-step.completed .wizard-step-bubble::after {
  content: '✓';
  font-size: 0.85rem;
}
.wizard-step.completed .wizard-step-label {
  color: var(--success);
}
.wizard-step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 0.25rem;
  margin-bottom: 1.25rem;
}
.wizard-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

/* ── FILE UPLOAD AREA ───────────────────────────────── */
.file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
  background: var(--gray-50);
}
.file-upload-area:hover,
.file-upload-area--drag {
  border-color: var(--primary);
  background: var(--primary-pale);
}
.file-upload-area--selected {
  border-color: var(--success);
  background: var(--success-light);
  border-style: solid;
}
.file-upload-area--error {
  border-color: var(--error);
  background: var(--error-light);
}

/* ── SELECT ELEMENT ─────────────────────────────────── */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* ── ROLE SELECTOR ───────────────────────────────────────── */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.role-option-wrap { cursor: pointer; }
.role-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 0.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  background: var(--white);
}
.role-option:hover,
.role-option.selected {
  border-color: var(--primary);
  background: var(--primary-pale);
}
.role-option-emoji { font-size: 1.4rem; margin-bottom: 0.25rem; }
.role-option-title { font-weight: 700; font-size: 0.85rem; font-family: var(--font-display); color: var(--accent); }
.role-option-sub   { font-size: 0.72rem; color: var(--gray-500); margin-top: 0.125rem; }

/* ── WIZARD STEPS BAR ────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 1.75rem;
  padding: 1rem 0.25rem;
}
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}
.wizard-step-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-400);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.wizard-step-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-400);
  white-space: nowrap;
  transition: color var(--transition);
}
.wizard-step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 0.375rem;
  margin-bottom: 1.1rem;
  transition: background var(--transition);
}
/* Active */
.wizard-step.active .wizard-step-bubble {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--accent);
}
.wizard-step.active .wizard-step-label { color: var(--accent); font-weight: 700; }
/* Done */
.wizard-step.done .wizard-step-bubble {
  border-color: var(--success);
  background: var(--success);
  color: var(--white);
  font-size: 0;
}
.wizard-step.done .wizard-step-bubble::after { content: '✓'; font-size: 0.8rem; }
.wizard-step.done + .wizard-step-line { background: var(--success); }
.wizard-step.done .wizard-step-label  { color: var(--success); }

/* ── WIZARD PANEL HEADING ────────────────────────────────── */
.wizard-panel-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}
.wizard-panel-emoji { font-size: 1.75rem; flex-shrink: 0; }
.wizard-panel-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.1rem;
}
.wizard-panel-sub { font-size: 0.8125rem; color: var(--gray-500); }

/* ── WIZARD NAV ROW ──────────────────────────────────────── */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
}

/* ── FILE UPLOAD AREA ────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.file-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-pale);
}

/* ── SELECT & TEXTAREA ───────────────────────────────────── */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}