/* ============================================================
   GODDY AI

   The mark is the school's gold on the school's navy, so it
   reads as part of this app rather than a bolted-on robot.
   Nothing here is purple, and there are no sparkles beyond the
   one mark: a feature that announces itself loudly in a
   teacher's workflow gets switched off.
   ============================================================ */

/* ── the full screen, shared by waiting / intro / preview ── */
.gai-screen {
  position: fixed;
  inset: 0;
  z-index: 9100;            /* above the catch-up screen, below toasts */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--navy-deep);
  opacity: 0;
  transition: opacity 200ms ease;
  overscroll-behavior: contain;
}
.gai-screen.open { opacity: 1; }

.gai-screen__inner {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* ── the mark, and the ring that turns while it thinks ──── */
.gai-orb {
  position: relative;
  width: 92px; height: 92px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gai-orb__ring {
  position: absolute;
  inset: 0;
  border-radius: var(--r-full);
  border: 2px solid rgba(212,160,23,0.18);
  border-top-color: var(--gold);
  animation: gai-spin 1.1s linear infinite;
}
.gai-orb__mark {
  width: 56px; height: 56px;
  border-radius: var(--r-full);
  background: rgba(212,160,23,0.14);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gai-breathe 2.2s ease-in-out infinite;
}
.gai-orb--still .gai-orb__mark { animation: none; }
.gai-orb__mark svg { width: 28px; height: 28px; }

@keyframes gai-spin { to { transform: rotate(360deg); } }
@keyframes gai-breathe {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.07); opacity: .88; }
}
/* Someone who has asked for less motion gets none of it. */
@media (prefers-reduced-motion: reduce) {
  .gai-orb__ring { animation: none; border-top-color: rgba(212,160,23,0.18); }
  .gai-orb__mark { animation: none; }
}

/* ── waiting ──────────────────────────────────────────────── */
.gai-wait__title {
  font-size: 21px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 10px;
}
.gai-wait__step {
  font-size: 14.5px;
  color: var(--gold);
  min-height: 22px;
  transition: opacity 180ms ease;
}
.gai-wait__note {
  margin-top: 22px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255,255,255,0.45);
}

/* ── the one-time offer ───────────────────────────────────── */
.gai-intro__kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.gai-intro__title {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 12px;
}
.gai-intro__body {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255,255,255,0.72);
  margin: 0 0 26px;
}
.gai-intro__cta { display: flex; align-items: center; justify-content: center; gap: 9px; }
.gai-intro__cta-mark { width: 18px; height: 18px; display: flex; }
.gai-intro__cta-mark svg { width: 18px; height: 18px; }
.gai-intro__foot {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.38);
}

/* ── buttons ──────────────────────────────────────────────── */
.gai-btn {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: var(--r-lg);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--fast), background var(--fast);
}
.gai-btn:active { transform: scale(0.98); }
.gai-btn--primary { background: var(--gold); color: var(--navy-deep); }
.gai-btn--ghost {
  background: none;
  color: rgba(255,255,255,0.6);
  min-height: 44px;
  font-weight: var(--semibold);
  font-size: 14px;
}
.gai-btn--ghost:hover { color: #fff; }

/* ── the preview ──────────────────────────────────────────── */
.gai-screen--preview { padding: 0; align-items: stretch; }

.gai-preview {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  /* Full height on a phone: the report is the whole point, and a
     card floating in the middle of a dark screen shows half of
     it. */
  height: 100%;
  background: var(--surface);
}
@media (min-width: 700px) {
  .gai-screen--preview { padding: 32px; align-items: center; }
  .gai-preview { height: min(88vh, 820px); border-radius: var(--r-xl); overflow: hidden; }
}

.gai-preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--navy-deep);
  color: #fff;
  flex-shrink: 0;
  padding-top: calc(14px + env(safe-area-inset-top));
}
.gai-preview__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
}
.gai-preview__mark { width: 19px; height: 19px; color: var(--gold); display: flex; }
.gai-preview__mark svg { width: 19px; height: 19px; }
.gai-preview__x {
  width: 34px; height: 34px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.7);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--r-full);
}
.gai-preview__x:hover { background: rgba(255,255,255,0.1); color: #fff; }

.gai-preview__toggle {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
  flex-shrink: 0;
}
.gai-seg {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.gai-seg.is-on {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: #fff;
}

.gai-preview__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-primary);
  -webkit-overflow-scrolling: touch;
}
.gai-preview__body p { margin: 0 0 14px; }
.gai-preview__body p:last-child { margin-bottom: 0; }
.gai-preview__body strong { color: var(--navy-deep); }

.gai-preview__foot {
  flex-shrink: 0;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-light);
  background: var(--surface);
}
.gai-preview__foot .gai-btn--primary { color: var(--navy-deep); }
.gai-preview__row { display: flex; gap: 8px; margin-top: 6px; }
.gai-preview__row .gai-btn--ghost { color: var(--text-muted); }
.gai-preview__row .gai-btn--ghost:hover { color: var(--navy-deep); }

/* ── the button inside the report composer ────────────────── */
.gai-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-bottom: 10px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(212,160,23,0.45);
  background: rgba(212,160,23,0.08);
  color: #8a6508;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
}
.gai-trigger:active { transform: scale(0.99); }
.gai-trigger:disabled { opacity: .55; cursor: default; }
.gai-trigger svg { width: 17px; height: 17px; }
.gai-trigger__left {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

/* The sample a super admin sees after testing the connection. */
.gai-sample {
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--bg);
  border: 1px solid var(--border-light);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}
.gai-sample p { margin: 0 0 12px; }
.gai-sample p:last-child { margin-bottom: 0; }
.gai-sample strong { color: var(--navy-deep); }
