/* =====================================================
   AI YouTube Assistant — Erika Vieira Brand Styles
   Matching erikavieira.net: light, warm, feminine
   ===================================================== */

:root {
  --tan: #C9A77B;
  --tan-dark: #BF9476;
  --tan-light: #d4b59e;
  --tan-pale: #f0e4db;
  --cta: #C9A77B;
  --cta-hover: #b8956c;
  --navy: #2D3E53;
  --bg: #F5F5F5;
  --bg-warm: #FBF8F5;
  --mauve: #E0BFBD;
  --mauve-light: #f3eaec;
  --gold: #C9A77B;
  --gold-deep: #BF9476;
  --gold-light: #e0c9a8;
  --gray: #54595F;
  --gray-light: #999;
  --white: #FFFFFF;
  --ivory: #FBF8F5;
  --error: #c0392b;
  --success: #2e7d52;
  --shadow-sm: 0 1px 3px rgba(45, 62, 83, 0.05);
  --shadow: 0 4px 18px rgba(45, 62, 83, 0.07);
  --shadow-lg: 0 14px 44px rgba(45, 62, 83, 0.13);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --font: 'Nunito', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-ui: 'Nunito', sans-serif;
  --transition: 0.2s ease;
}

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

html {
  /* Stop the page from scrolling sideways. The mobile menu is a position:fixed panel
     parked off-screen-left at translateX(-100%); without this, iOS Safari lets you
     scroll horizontally to "chase" it, dragging the whole layout off-center. The panel
     still slides into view when tapped because fixed elements aren't clipped here. */
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-warm);
  color: var(--navy);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =====================================================
   Screens
   ===================================================== */
.screen { display: none; }
.screen.active { display: flex; }

/* =====================================================
   Auth Screen — New premium split layout
   ===================================================== */
#auth-screen {
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.auth-page {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: linear-gradient(148deg, #fdfaf7 0%, #f7ede6 22%, #f0e0d3 50%, #e8d4c0 74%, #dfc8a8 100%);
  position: relative;
}

.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 90%, rgba(224,191,189,0.50) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 10%, rgba(249,244,241,0.65) 0%, transparent 45%);
}

.auth-panel-left {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.auth-illustration {
  position: relative;
  z-index: 2;
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

.auth-panel-right {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 60px;
  background: #faf5f0;
  border-left: 1px solid rgba(201,167,123,0.25);
  box-shadow: -24px 0 80px rgba(90,55,20,0.10);
  position: relative;
  z-index: 5;
  overflow-y: auto;
}

.auth-hero-logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 28px;
}

.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(201,167,123,0.30);
}

.auth-divider-gem {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #C9A77B, #b08a58);
  box-shadow: 0 0 8px rgba(201,167,123,0.55);
}

.auth-field {
  width: 100%;
  margin-bottom: 18px;
}

.auth-field label {
  font-size: 9px;
  letter-spacing: 3.5px;
  color: #2D3E53;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

.auth-field input {
  width: 100%;
  padding: 14px 18px;
  background: #ffffff;
  border: 1.5px solid rgba(201,167,123,0.35);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #141623;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.auth-field input::placeholder { color: #c4b5af; }

.auth-field input:focus {
  border-color: #C9A77B;
  box-shadow: 0 0 0 4px rgba(201,167,123,0.11);
}

.auth-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #C9A77B 0%, #c09b69 55%, #b08a58 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 6px 24px rgba(201,167,123,0.42);
  margin-top: 4px;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(201,167,123,0.52);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: rgba(201,167,123,0.12);
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #a09690;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-tab.active {
  background: #C9A77B;
  color: #ffffff;
}

.auth-form { display: none; width: 100%; }
.auth-form.active { display: block; }

@media (max-width: 768px) {
  .auth-page { flex-direction: column; height: auto; min-height: 100vh; }
  .auth-panel-left { height: 40vh; width: 100%; flex: none; }
  .auth-panel-right { width: 100%; padding: 36px 24px 48px; box-shadow: none; border-left: none; border-top: 1px solid rgba(201,167,123,0.25); }
}

.brand-logo {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.brand-tagline {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--tan);
  margin-bottom: 20px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.brand-description {
  font-size: 1.05rem;
  color: var(--gray);
  line-height: 1.7;
}

.auth-card {
  flex: 1;
  background: var(--white);
  border-radius: 0;
  padding: 60px 48px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 0;
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  border-radius: 2px;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 13px 18px;
  border: 1px solid #d4ccc6;
  border-radius: 0;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--navy);
  transition: var(--transition);
  outline: none;
  background: var(--white);
}

.form-group input:focus {
  border-color: var(--tan);
  box-shadow: 0 0 0 3px rgba(191, 148, 118, 0.12);
  background: var(--white);
}

.auth-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}

.auth-success {
  color: #2e7d52;
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}

.auth-forgot {
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
}

.auth-forgot a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.auth-forgot a:hover { text-decoration: underline; }

.auth-forgot-intro {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 18px;
  line-height: 1.6;
}

/* =====================================================
   Buttons — Erika uses brick red CTAs
   ===================================================== */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.btn-primary {
  background: var(--cta);
  color: var(--white);
  padding: 16px 32px;
  font-size: 0.75rem;
}
.btn-primary:hover { background: var(--cta-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201, 167, 123, 0.3); }

.btn-full { width: 100%; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--tan);
  color: var(--tan);
  padding: 8px 16px;
  font-size: 0.8rem;
}
.btn-outline:hover { background: var(--tan-pale); color: var(--navy); }

.btn-ghost {
  background: transparent;
  color: var(--gray);
  padding: 8px 16px;
  font-size: 0.8rem;
}
.btn-ghost:hover { color: var(--navy); }

.btn-small { font-size: 0.8rem; padding: 8px 16px; }

.btn-send {
  background: var(--cta);
  color: var(--white);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  text-transform: none;
  letter-spacing: 0;
}
.btn-send:hover { background: var(--cta-hover); box-shadow: 0 3px 10px rgba(201, 167, 123, 0.3); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-mic {
  background: var(--white);
  color: var(--cta);
  border: 1px solid #d4ccc6;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  text-transform: none;
  letter-spacing: 0;
  transition: all 0.2s;
}
.btn-mic:hover { background: #faf7f3; }
.btn-mic.recording {
  background: #e74c3c;
  color: var(--white);
  border-color: #e74c3c;
  animation: mic-pulse 1.4s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

/* =====================================================
   App Layout — Light sidebar matching Erika's site
   ===================================================== */
#app-screen {
  height: 100vh;
  overflow: hidden;
  /* Containing block for the mobile off-canvas sidebar (position:absolute below), so
     this element's overflow:hidden actually clips the parked-off-screen sidebar. Fixed
     positioning escaped this clip and let iOS Safari scroll sideways to the panel. */
  position: relative;
}

#sidebar {
  width: 280px;
  background: var(--white);
  color: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  border-right: 1px solid #ede7e2;
}

.sidebar-brand {
  padding: 28px 24px 22px;
  border-bottom: 1px solid #ede7e2;
  text-align: center;
}

.sidebar-logo {
  width: 100%;
  max-width: 210px;
  height: 104px;
  object-fit: cover;
  object-position: center top;
  display: block;
  margin: 0 auto;
}

.sidebar-user {
  font-size: 0.8rem;
  color: var(--gold-deep);
  margin-top: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.step-nav {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px 13px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
  position: relative;
  color: var(--gray);
}

/* Gold left-accent bar on the active step */
.step-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--gold);
}

.step-item:hover { background: var(--tan-pale); color: var(--navy); }
.step-item.active { background: var(--ivory); color: var(--navy); }
.step-item.completed { color: var(--navy); }
.step-item.completed .step-number { background: var(--tan); color: var(--white); }

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ede7e2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: var(--transition);
  color: var(--gray);
}

.step-item.active .step-number {
  background: var(--tan);
  color: var(--white);
}

.step-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.step-status {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--gray-light);
}

.step-item.completed .step-status::after { content: '✓'; color: var(--tan); font-size: 1rem; font-weight: 800; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #ede7e2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =====================================================
   Step Progress Bar — top of chat
   ===================================================== */
.step-progress-bar {
  height: 8px;
  background: #ede7e2;
  flex-shrink: 0;
  position: relative;
}

.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tan-dark), var(--cta));
  border-radius: 0 4px 4px 0;
  width: 2%;
  min-width: 2%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-progress-counter {
  font-size: 12px;
  color: #6d5a4d;
  padding: 4px 16px 6px;
  text-align: right;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* =====================================================
   Chat Area — Warm, inviting
   ===================================================== */
#chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-warm);
}

.chat-header {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--navy);
  position: relative;
}

/* thin gold hairline accent on the navy header */
.chat-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(201, 167, 123, 0.55);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--white);
  cursor: pointer;
  padding: 4px;
}

.chat-header-info h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.2px;
}

.chat-header-info p {
  font-size: 0.85rem;
  color: var(--gold-light);
  margin-top: 3px;
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  /* overflow-y:auto makes overflow-x compute to auto too, letting any too-wide content
     scroll the message list sideways. Clip it so the chat can't scroll horizontally. */
  overflow-x: hidden;
  padding: 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Message Bubbles — soft, rounded, warm */
.message {
  max-width: 82%;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.assistant {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  max-width: 76%;
}

/* Assistant row: EV avatar + name + bubble */
.message-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 8px rgba(201, 167, 123, 0.30);
  background: var(--white);
}

.message-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.message-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.4px;
  margin: 2px 0 5px 2px;
}

.message-bubble {
  padding: 15px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.7;
}

.message.assistant .message-bubble {
  background: var(--white);
  color: var(--navy);
  border-radius: 4px 16px 16px 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201, 167, 123, 0.18);
}

.message.user .message-bubble {
  background: var(--navy);
  color: var(--white);
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 3px 12px rgba(45, 62, 83, 0.18);
}

.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  margin: 12px 0 8px;
  font-size: 1rem;
  font-weight: 800;
}
.message-bubble h1:first-child, .message-bubble h2:first-child, .message-bubble h3:first-child {
  margin-top: 0;
}

.message-bubble p { margin-bottom: 8px; }
.message-bubble p:last-child { margin-bottom: 0; }

.message-bubble ul, .message-bubble ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message-bubble li { margin-bottom: 4px; }

.message-bubble strong { font-weight: 800; }

.message-bubble em { font-style: italic; }

/* Typing Indicator — sits inside EV's message row */
.typing-indicator {
  display: inline-flex;
  gap: 6px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: 4px 16px 16px 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201, 167, 123, 0.18);
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--tan);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Quick Replies — soft mauve pills */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 28px;
}

.quick-reply {
  padding: 10px 20px;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid rgba(45, 62, 83, 0.22);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quick-reply:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 167, 123, 0.3);
}

/* Chat Input */
.chat-input-area {
  padding: 16px 40px 24px;
  background: var(--bg-warm);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.chat-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  /* Critical on mobile: a textarea's default min-width is its intrinsic size, so with
     just flex:1 it refuses to shrink and forces the input row wider than the screen,
     causing the whole page to scroll sideways. min-width:0 lets it shrink to fit. */
  min-width: 0;
  padding: 14px 20px;
  border: 1.5px solid rgba(201, 167, 123, 0.35);
  border-radius: var(--radius-lg);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--navy);
  resize: none;
  outline: none;
  max-height: 150px;
  line-height: 1.5;
  transition: var(--transition);
  background: var(--white);
}

#chat-input:focus {
  border-color: var(--cta);
  box-shadow: 0 0 0 2px rgba(201, 167, 123, 0.15);
}

/* =====================================================
   Progress Bar (in messages)
   ===================================================== */
.progress-bar-container {
  background: #ede7e2;
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 8px;
  background: linear-gradient(90deg, var(--tan), var(--gold-deep));
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* =====================================================
   Documents Modal
   ===================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(191, 148, 118, 0.3);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid #ede7e2;
  position: sticky;
  top: 0;
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray);
  cursor: pointer;
  padding: 4px 8px;
}

.documents-list {
  padding: 24px 28px;
}

.document-card {
  border: 2px solid #ede7e2;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.document-card:hover {
  border-color: var(--tan);
  box-shadow: var(--shadow);
}

.document-card h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.document-card p {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 12px;
}

.document-actions {
  display: flex;
  gap: 8px;
}

.btn-download {
  background: var(--cta);
  color: var(--white);
  padding: 12px 24px;
  font-size: 0.72rem;
}
.btn-download:hover { background: var(--cta-hover); }

.empty-state {
  text-align: center;
  color: var(--gray);
  padding: 40px 20px;
  font-size: 0.95rem;
}

/* =====================================================
   PDF Styles (used during generation)
   ===================================================== */
.pdf-document {
  font-family: 'Georgia', serif;
  max-width: 700px;
  margin: 0 auto;
  padding: 40px;
  color: #2D3E53;
  line-height: 1.8;
}

.pdf-header {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 3px double #C9A77B;
}

.pdf-header h1 {
  font-family: 'Georgia', serif;
  font-size: 1.8rem;
  color: #2D3E53;
  margin-bottom: 8px;
}

.pdf-header p {
  color: #C9A77B;
  font-size: 0.9rem;
  font-style: italic;
}

.pdf-section {
  margin-bottom: 28px;
  padding-left: 16px;
  border-left: 4px double #C9A77B;
}

.pdf-section h2 {
  font-family: 'Georgia', serif;
  font-size: 1.2rem;
  color: #C9A77B;
  margin-bottom: 10px;
}

.pdf-section p, .pdf-section li {
  font-family: 'Calibri', 'Nunito', sans-serif;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.pdf-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid #C9A77B;
  color: #C9A77B;
  font-size: 0.85rem;
  font-style: italic;
}

/* =====================================================
   Accessibility — visible focus states
   ===================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.quick-reply:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* =====================================================
   "Meet EV" one-time welcome
   ===================================================== */
.ev-welcome-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45, 62, 83, 0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.ev-welcome-overlay.active { display: flex; }

.ev-welcome-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 0 36px 36px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.ev-welcome-banner {
  background: var(--navy);
  margin: 0 -36px 0;
  padding: 30px 36px 26px;
}

.ev-welcome-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ev-welcome-card h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy);
  margin: 24px 0 4px;
}

.ev-welcome-card .ev-welcome-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold-deep);
  font-weight: 700;
  margin-bottom: 16px;
}

.ev-welcome-card p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--gray);
  margin-bottom: 26px;
}

.ev-welcome-card .auth-btn {
  width: auto;
  padding: 14px 40px;
}

/* =====================================================
   Refined scrollbars
   ===================================================== */
.chat-messages::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
#sidebar::-webkit-scrollbar {
  width: 8px;
}
.chat-messages::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb {
  background: rgba(201, 167, 123, 0.4);
  border-radius: var(--radius-pill);
}
.chat-messages::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 167, 123, 0.65);
}
.chat-messages, .modal-content, #sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 167, 123, 0.4) transparent;
}

/* =====================================================
   Mobile Responsive
   ===================================================== */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
    gap: 32px;
  }

  /* Slightly smaller EV avatar on phones */
  .message-avatar { width: 34px; height: 34px; }
  .message.assistant { max-width: 90%; }

  .auth-brand {
    text-align: center;
  }

  .brand-logo {
    font-size: 2rem;
  }

  .auth-card {
    max-width: 100%;
  }

  #sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 50;
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-toggle {
    display: block;
  }

  .message {
    max-width: 92%;
  }

  .chat-messages {
    padding: 16px;
  }

  .chat-input-area {
    padding: 12px 16px 16px;
  }

  /* Cap the growing text box lower on phones so a long answer can't expand far
     enough to cover the question above it in the conversation. */
  #chat-input {
    max-height: 96px;
  }

  .quick-replies {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    font-size: 1.6rem;
  }

  .auth-card {
    padding: 24px;
  }

  .message-bubble {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}
