/* ==========================================================================
   AI LIFT - Weekly Win Interview
   Static visual mockup styles. Brand tokens live in :root as CSS variables.
   ========================================================================== */

:root {
  /* Brand colors */
  --color-gate-bg: #0F3D44;
  --color-content-bg: #1F2D30;
  --color-amber: #EE9B00;
  --color-amber-dim: #c9860a;
  --color-teal: #157A6E;
  --color-teal-light: #2A9D8F;
  --color-white: #FFFFFF;
  --color-body: #EAF4F2;
  --color-muted: #BFE0DA;

  /* Derived surfaces */
  --color-card-bg: #24373a;
  --color-card-bg-raised: #2b4144;
  --color-input-bg: #1a292c;
  --color-student-bubble-bg: rgba(238, 155, 0, 0.16);
  --color-student-bubble-border: rgba(238, 155, 0, 0.45);
  --color-assistant-bubble-bg: #24373a;

  /* Type */
  --font-family: Calibri, 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';

  /* Shape */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.28);
  --shadow-card-soft: 0 6px 18px rgba(0, 0, 0, 0.22);

  /* Motion */
  --transition-fast: 160ms ease;
  --transition-medium: 320ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--color-content-bg);
  color: var(--color-body);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden {
  display: none !important;
}

/* ==========================================================================
   App shell / state visibility
   ========================================================================== */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

.app-state:not(.is-active) {
  display: none !important;
}

/* ==========================================================================
   Wordmark
   ========================================================================== */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2em;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.wordmark__ai {
  color: var(--color-amber);
}

.wordmark__lift {
  color: var(--color-white);
}

.wordmark--lg {
  font-size: 2rem;
}

.wordmark--sm {
  font-size: 1.05rem;
}

/* ==========================================================================
   State 1: Sign-in gate
   ========================================================================== */

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gate-bg);
  padding: 24px;
  transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.gate.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(42, 157, 143, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 32px;
  text-align: center;
}

.gate-card__wordmark {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.gate-card__title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
}

.gate-card__subtitle {
  margin: 0 0 32px;
  font-size: 0.95rem;
  color: var(--color-muted);
  font-style: italic;
  line-height: 1.5;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  background: var(--color-white);
  color: #1f1f1f;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.google-btn:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

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

.google-btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}

.google-btn__icon {
  flex-shrink: 0;
}

/* ==========================================================================
   State 2: Chat
   ========================================================================== */

.chat {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-content-bg);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(42, 157, 143, 0.25);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--color-content-bg);
  z-index: 5;
}

.chat-header__user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-header__name {
  font-size: 0.9rem;
  color: var(--color-body);
}

.chat-header__signout {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.chat-header__signout:hover {
  color: var(--color-white);
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* ---- message bubbles ---- */

.message {
  display: flex;
  max-width: 100%;
  gap: 10px;
  align-items: flex-end;
}

.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar--al {
  background: var(--color-amber);
  color: #1F2D30;
}

.avatar--student {
  background: var(--color-teal-light);
  color: #FFFFFF;
}

.message--assistant {
  justify-content: flex-start;
}

.message--student {
  justify-content: flex-end;
}

.message__bubble {
  max-width: 78%;
  padding: 13px 17px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  line-height: 1.55;
  box-shadow: var(--shadow-card-soft);
  white-space: pre-line; /* honor \n paragraph breaks in message text */
}

.message--assistant .message__bubble {
  background: var(--color-assistant-bubble-bg);
  border: 1px solid rgba(42, 157, 143, 0.4);
  color: var(--color-body);
  border-bottom-left-radius: 4px;
}

.message--student .message__bubble {
  background: var(--color-student-bubble-bg);
  border: 1px solid var(--color-student-bubble-border);
  color: var(--color-white);
  border-bottom-right-radius: 4px;
}

/* ---- typing indicator ---- */

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
}

.typing-indicator__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-teal-light);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-indicator__dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator__dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ---- chat input row ---- */

.chat-input-row {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: var(--color-content-bg);
  border-top: 1px solid rgba(42, 157, 143, 0.25);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}

.chat-input-form {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.chat-input-form__field {
  flex: 1;
  padding: 12px 16px;
  background: var(--color-input-bg);
  border: 1px solid rgba(42, 157, 143, 0.4);
  border-radius: var(--radius-pill);
  color: var(--color-white);
  font-size: 1.1rem;
  font-family: inherit;
}

.chat-input-form__field::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

.chat-input-form__field:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 1px;
  border-color: var(--color-amber);
}

.send-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-amber);
  border: none;
  color: #1f1500;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.send-btn:hover {
  background: var(--color-amber-dim);
}

.send-btn:active {
  transform: scale(0.94);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Quick-reply chips (bootstrap module/weekly picker)
   ========================================================================== */

.message--chips {
  align-items: flex-start;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 78%;
  padding-top: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-card-bg);
  border: 1px solid rgba(42, 157, 143, 0.5);
  border-radius: var(--radius-pill);
  color: var(--color-body);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--color-amber);
  color: var(--color-white);
}

.chip:active {
  transform: scale(0.97);
}

.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.chip--done {
  border-color: var(--color-teal-light);
}

.chip__suffix {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-muted);
}

.chip--done .chip__suffix {
  color: var(--color-teal-light);
}

.chip__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-teal);
  flex-shrink: 0;
}

.chip__check svg {
  width: 9px;
  height: 9px;
}

/* ==========================================================================
   State 3: Confirmation card (inline in chat stream)
   ========================================================================== */

.confirm-card {
  width: 100%;
  max-width: 78%;
  background: var(--color-card-bg);
  border: 1px solid var(--color-teal-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-soft);
  padding: 20px;
}

.confirm-card__title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
}

.confirm-field {
  margin-bottom: 14px;
}

.confirm-field:last-of-type {
  margin-bottom: 0;
}

.confirm-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.confirm-field__control {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-input-bg);
  border: 1px solid rgba(42, 157, 143, 0.45);
  border-radius: var(--radius-sm);
  color: var(--color-white);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.5;
}

.confirm-field__control:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 1px;
  border-color: var(--color-amber);
}

textarea.confirm-field__control {
  resize: vertical;
  min-height: 72px;
}

select.confirm-field__control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23BFE0DA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.confirm-card__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  background: var(--color-amber);
  color: #1f1500;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--color-amber-dim);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-quiet {
  background: none;
  border: none;
  padding: 4px;
  color: var(--color-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.btn-quiet:hover {
  color: var(--color-white);
}

/* ==========================================================================
   State 4: Logged / success card
   ========================================================================== */

.success-card {
  max-width: 78%;
  background: var(--color-card-bg);
  border: 1px solid var(--color-teal-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-soft);
  padding: 24px;
  text-align: center;
}

.success-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-teal);
  margin-bottom: 14px;
}

.success-card__badge svg {
  width: 24px;
  height: 24px;
}

.success-card__headline {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-white);
}

.success-card__line {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--color-muted);
  font-style: italic;
  line-height: 1.5;
}

/* ==========================================================================
   Dev strip (design review only, strip before shipping)
   ========================================================================== */

.dev-strip {
  position: fixed;
  right: 12px;
  bottom: 76px;
  z-index: 999;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: rgba(15, 61, 68, 0.65);
  border: 1px solid rgba(42, 157, 143, 0.4);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
}

.dev-strip__btn {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 224, 218, 0.3);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.dev-strip__btn:hover {
  background: var(--color-amber);
  color: #1f1500;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
  .gate-card {
    padding: 32px 22px;
  }

  .message__bubble,
  .confirm-card,
  .success-card {
    max-width: 88%;
  }

  .chip-group {
    max-width: 88%;
  }

  .dev-strip__btn {
    padding: 6px 8px;
    font-size: 0.62rem;
  }
}

@media (min-width: 1024px) {
  .chat-stream {
    max-width: 820px;
  }

  .chat-input-form {
    max-width: 820px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .typing-indicator__dot {
    animation: none;
    opacity: 0.9;
  }
}
