/* Local Brand Fonts from Tracey's Collection */
@font-face {
  font-family: 'JHCRasbora';
  src: url('/fonts/JHCRasbora-Extrabold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
}
@font-face {
  font-family: 'CinzelCustom';
  src: url('/fonts/Cinzel-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/fonts/Cinzel-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'MadeTommy';
  src: url('/fonts/MadeTommy-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Cocogoose';
  src: url('/fonts/Cocogoose-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}
@font-face {
  font-family: 'ModernRomance';
  src: url('/fonts/ModernRomance.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Modern Romance';
  src: url('/fonts/ModernRomance.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'BethanyElingston';
  src: url('/fonts/BethanyElingston.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Bethany Elingston';
  src: url('/fonts/BethanyElingston.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'RelationshipOfMelodrame';
  src: url('/fonts/RelationshipOfMelodrame.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Mermaid';
  src: url('/fonts/Mermaid1001.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'KenyanCoffee';
  src: url('/fonts/KenyanCoffee-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'ZTNature';
  src: url('/fonts/ZTNature-Black.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

:root {
  --bg-dark: #0f1117;
  --card-bg: #161922;
  --card-border: #232736;
  --text-main: #f3f4f6;
  --text-muted: #9aa1b2;
  --primary: #f472b6;
  --primary-glow: rgba(244, 114, 182, 0.35);
  --accent: #fb7185;
  --accent-gold: #fde047;
  --accent-sage: #86efac;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(22, 25, 34, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-badge {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(216, 180, 254, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.logo-badge-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-header h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #fff, #fed7aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(134, 239, 172, 0.12);
  color: var(--accent-sage);
  border: 1px solid rgba(134, 239, 172, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-sage);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(134, 239, 172, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(134, 239, 172, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(134, 239, 172, 0); }
}

/* Workspace Layout */
.studio-workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  padding: 28px 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1080px) {
  .studio-workspace {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title h3 {
  font-size: 15px;
  font-weight: 700;
}

.step-num {
  background: linear-gradient(135deg, #f472b6, #fb923c);
  color: white;
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Layout Selector */
.layout-selector-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.layout-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #0f1118;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.layout-card:hover {
  border-color: rgba(244, 114, 182, 0.4);
}

.layout-card.active {
  border-color: #f472b6;
  background: rgba(244, 114, 182, 0.08);
}

.layout-icon {
  font-size: 24px;
}

.layout-info strong {
  display: block;
  font-size: 13px;
  color: #fff;
}

.layout-info span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Form Controls */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #0b0c12;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.2);
}

textarea.form-control {
  resize: vertical;
  line-height: 1.6;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.audio-upload-wrapper {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-sm);
}

.sub-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.file-input {
  font-size: 12px;
  color: var(--text-muted);
}

/* Theme Grid */
.layout-selector-grid-6 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .layout-selector-grid-6 {
    grid-template-columns: 1fr;
  }
}

optgroup {
  background: #181622;
  color: #c084fc;
  font-weight: 700;
  padding: 6px 4px;
}
optgroup option {
  background: #0f111a;
  color: #f1f5f9;
  font-weight: normal;
  padding: 6px 8px;
}

.water-bg { background: linear-gradient(135deg, #0f3a40, #48cae4); }
.forest-bg { background: linear-gradient(135deg, #1b4332, #52b788); }

.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.theme-card {
  background: #0b0c12;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.theme-card:hover {
  border-color: rgba(244, 114, 182, 0.5);
}

.theme-card.active {
  border-color: #f472b6;
  background: rgba(244, 114, 182, 0.08);
}

.theme-preview {
  height: 40px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.road-bg { background: linear-gradient(135deg, #f59e0b, #0284c7); }
.twilight-bg { background: linear-gradient(135deg, #1e1b4b, #f43f5e); }
.sunburst-bg { background: linear-gradient(135deg, #fde047, #f97316); }
.flower-bg { background: linear-gradient(135deg, #f472b6, #eab308); }
.greenhouse-bg { background: linear-gradient(135deg, #15803d, #86efac); }
.dusk-bg { background: linear-gradient(135deg, #0369a1, #fb7185); }
.shadow-bg { background: linear-gradient(135deg, #e7e5e4, #78716c); }
.linen-bg { background: linear-gradient(135deg, #fef3c7, #d97706); }

.hidden {
  display: none !important;
}

.theme-card span {
  font-size: 11px;
  font-weight: 600;
  display: block;
}

/* Checkbox */
.checkbox-group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.custom-checkbox input {
  accent-color: #f472b6;
  width: 16px;
  height: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #f472b6, #fb7185);
  color: white;
  box-shadow: 0 4px 14px rgba(244, 114, 182, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.5);
}

.btn-secondary {
  background: #1c202d;
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: #252b3d;
}

.btn-accent {
  background: linear-gradient(135deg, #fb7185, #f59e0b);
  color: white;
  box-shadow: 0 4px 18px rgba(251, 113, 133, 0.35);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(251, 113, 133, 0.5);
}

.btn-drive {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: white;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
}

.btn-drive:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #1e40af, #2563eb);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.55);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
}

.btn-block {
  width: 100%;
}

/* Phone Simulator */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-mockup-wrapper {
  margin-bottom: 18px;
}

.phone-frame {
  width: 340px;
  height: 604px; /* 9:16 aspect ratio */
  background: #000;
  border-radius: 46px;
  border: 9px solid #232736;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
}

.canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
}

#videoCanvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* TikTok UI Overlay */
.tiktok-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 14px 20px 14px;
  transition: opacity 0.3s ease;
  user-select: none;
}

.tiktok-overlay.hidden {
  opacity: 0;
}

.tt-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.tt-center-tabs {
  display: flex;
  gap: 16px;
}

.tt-center-tabs span {
  opacity: 0.6;
}

.tt-center-tabs span.active {
  opacity: 1;
  position: relative;
}

.tt-center-tabs span.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.tt-actions {
  position: absolute;
  right: 12px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tt-btn-profile .avatar {
  width: 40px;
  height: 40px;
  background: #f472b6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1.5px solid #fff;
}

.tt-btn-profile .plus-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: #f472b6;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.tt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tt-btn .icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7));
}

.tt-btn .count {
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.tt-music-disc .disc-spin {
  width: 36px;
  height: 36px;
  background: #111;
  border-radius: 50%;
  border: 4px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  animation: spin 5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tt-bottom {
  max-width: 76%;
  margin-top: auto;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

.tt-username {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tt-caption {
  font-size: 11px;
  opacity: 0.9;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tt-audio-track {
  font-size: 10px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Controls & Export */
.player-controls {
  width: 340px;
  margin-bottom: 18px;
}

.playback-buttons {
  display: flex;
  gap: 10px;
}

.playback-buttons .btn {
  flex: 1;
}

.export-box {
  width: 340px;
}

.export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.export-header h4 {
  font-size: 15px;
  font-weight: 700;
}

.badge-tag {
  font-size: 10px;
  font-weight: 700;
  background: rgba(244, 114, 182, 0.15);
  color: #f472b6;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(244, 114, 182, 0.3);
}

.export-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

.export-status {
  margin-top: 14px;
  padding: 10px;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #fbcfe8;
}

.export-status.hidden {
  display: none;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(244, 114, 182, 0.3);
  border-top-color: #f472b6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.copy-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}

.copy-section label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.copy-box {
  display: flex;
  gap: 8px;
}

.copy-box textarea {
  flex: 1;
  background: #0b0c12;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 11px;
  padding: 6px 8px;
  resize: none;
}

/* ==============================================================================
   Mobile Optimization for iPhone & Google Pixel (iOS & Android)
   ============================================================================== */

/* Mobile Nav Bar - Hidden on Desktop */
.mobile-nav-bar {
  display: none;
}

@media (max-width: 900px) {
  /* Show Mobile Segmented Navigation Bar */
  .mobile-nav-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    padding: 8px 12px;
    gap: 8px;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-nav-btn {
    flex: 1;
    max-width: 220px;
    min-height: 44px; /* Apple & Android Touch Target Standard */
    padding: 10px 14px;
    border-radius: 9999px;
    border: 1px solid var(--card-border);
    background: #151926;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn.active {
    background: linear-gradient(135deg, #f472b6, #fb7185);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(244, 114, 182, 0.4);
  }

  /* Safe Area Support for iPhone Dynamic Island & Pixel Notch */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent auto-zoom on iOS Safari when focusing form inputs */
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* iOS threshold to prevent camera zoom */
  }

  /* Mobile Header */
  .app-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .app-header h1 {
    font-size: 17px;
  }

  .header-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Mobile Workspace Layout */
  .studio-workspace {
    padding: 12px 10px;
    gap: 14px;
    display: flex;
    flex-direction: column;
  }

  /* Cards */
  .card {
    padding: 16px 12px;
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .card-header h3 {
    font-size: 14px;
  }

  /* Phone Mockup on Mobile */
  .phone-mockup-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
  }

  .phone-frame {
    width: min(340px, 88vw);
    height: auto;
    aspect-ratio: 9 / 16;
    border-width: 6px;
    border-radius: 36px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  }

  .phone-island {
    width: 76px;
    height: 18px;
    top: 6px;
  }

  /* Touch Targets: minimum 44px height */
  .btn {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 16px;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
  }

  /* Smooth Touch-Friendly Range Sliders for iOS & Android */
  input[type="range"] {
    height: 28px;
    -webkit-appearance: none;
    background: transparent;
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f472b6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    margin-top: -8px;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
    background: #1c202d;
  }

  /* Layout and Theme Grids */
  .layout-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .theme-selector-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .theme-card {
    padding: 6px 4px;
  }

  .theme-preview {
    height: 36px;
  }

  /* Export Action Box */
  .export-btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .export-btn-group .btn {
    margin-top: 0 !important;
  }

  /* Hide tabs conditionally if toggled on mobile */
  .mobile-hidden {
    display: none !important;
  }
}

/* ==========================================================================
   Workspace & Guest Authentication Gate
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(5, 10, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

.auth-gate-card {
  width: 100%;
  max-width: 440px;
  background: #09130d;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 28px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(216, 180, 254, 0.15);
  position: relative;
  overflow: hidden;
}

.auth-gate-card::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 200px;
  background: radial-gradient(circle, rgba(216, 180, 254, 0.25) 0%, rgba(244, 114, 182, 0.12) 50%, transparent 70%);
  pointer-events: none;
}

.auth-gate-badge {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
}

.auth-gate-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 20px rgba(216, 180, 254, 0.4);
}

.auth-lock-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #051009;
  border: 1px solid rgba(52, 211, 153, 0.4);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.auth-gate-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: #fff0c7;
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

.auth-gate-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #f472b6;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0 0 16px 0;
}

.auth-domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 78, 59, 0.6);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #a7f3d0;
  margin-bottom: 14px;
}

.auth-gate-desc {
  font-size: 12px;
  line-height: 1.55;
  color: #d1d5db;
  margin: 0 0 18px 0;
}

.auth-email-tag {
  color: #fbcfe8;
  font-family: monospace;
  font-size: 11px;
  background: rgba(244, 114, 182, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(244, 114, 182, 0.25);
  word-break: break-all;
}

.auth-error-banner {
  background: rgba(127, 29, 29, 0.85);
  border: 1px solid #ef4444;
  color: #fecaca;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 11.5px;
  line-height: 1.4;
  margin-bottom: 16px;
  text-align: left;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.google-sign-in-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #111827;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  min-height: 48px;
}

.google-sign-in-btn:hover {
  background: #fdf2f8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.25);
}

.google-sign-in-btn:active {
  transform: translateY(0);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 6px 0;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  padding: 0 10px;
}

.passcode-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.passcode-input-group {
  display: flex;
  gap: 8px;
}

.passcode-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.passcode-input:focus {
  border-color: #f472b6;
  background: rgba(255, 255, 255, 0.09);
}

.passcode-btn {
  background: rgba(244, 114, 182, 0.2);
  border: 1px solid rgba(244, 114, 182, 0.4);
  color: #fbcfe8;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.passcode-btn:hover {
  background: #f472b6;
  color: #111827;
}

.passcode-hint {
  font-size: 10.5px;
  color: #9ca3af;
  text-align: center;
}

.auth-footer-badge {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #6b7280;
  font-family: monospace;
}

/* User Auth Badge in Header */
.user-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #a7f3d0;
}

.user-auth-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

.user-auth-email {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-sign-out-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 10px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: 2px;
}

.auth-sign-out-btn:hover {
  color: #f87171;
}
