/* ============================================================
   ASCENSION AGENT GROUP — Member Portal
   Brand palette (from official brand guideline):
     Black        #000000
     Electric Blue#0e78be
     Stone Grey   #bbbcbb
     White        #ffffff
   ============================================================ */

:root {
  --blue: #0e78be;
  --blue-dark: #0a5e95;
  --blue-darker: #063f64;
  --black: #000000;
  --ink: #0f1b25;
  --grey: #bbbcbb;
  --grey-light: #eef1f3;
  --grey-mid: #6b7682;
  --white: #ffffff;
  --danger: #c0392b;
  --success: #1e8a4c;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(8, 30, 48, 0.18);
  --shadow-sm: 0 6px 18px rgba(8, 30, 48, 0.10);
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--grey-light);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

/* ---------- Full-screen mountain backdrop ---------- */
.backdrop {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(6, 26, 43, 0.45) 0%, rgba(6, 26, 43, 0.28) 40%, rgba(8, 34, 56, 0.62) 100%),
    url('../assets/hero-poster.jpg') center / cover no-repeat fixed;
}

/* ---------- Live mountain/cloud video background (landing page) ---------- */
/* When the landing page provides a video layer, the .backdrop itself goes
   transparent so the moving footage shows through behind the content. */
.backdrop.has-hero-video { background: transparent; }

.hero-media {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  /* Light, airy sky shown for the instant before the poster/video paints —
     so there is never a dark "moody" flash on first load. */
  background: linear-gradient(180deg, #9fc0db 0%, #e7f0f6 100%);
}
.hero-media .hero-video,
.hero-media .hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  animation: heroDrift 36s ease-in-out infinite alternate; /* slow zoom drift */
  transform-origin: center;
}
/* The video starts hidden and crossfades in over the bright poster once it
   actually begins playing — so the handoff from still image to footage is a
   smooth fade, never a hard pop. */
.hero-media .hero-video { opacity: 0; transition: opacity .8s ease; }
.hero-media .hero-video.is-playing { opacity: 1; }
@keyframes heroDrift { from { transform: scale(1); } to { transform: scale(1.08); } }
@media (max-width: 767px) {
  .hero-media .hero-video, .hero-media .hero-poster {
    animation-name: heroDriftSm; animation-duration: 28s;
  }
}
@keyframes heroDriftSm { from { transform: scale(1); } to { transform: scale(1.06); } }

.hero-scrim {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(at 18% 26%, rgba(14, 120, 190, 0.26) 0px, transparent 52%),
    linear-gradient(180deg, rgba(8, 16, 24, 0.58) 0%, rgba(8, 16, 24, 0.34) 45%, rgba(9, 20, 30, 0.74) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .hero-media .hero-video, .hero-media .hero-poster { animation: none; }
}

/* ---------- Brand lockup ---------- */
.brand-lockup {
  text-align: center;
  margin-bottom: 26px;
}
.brand-lockup img { height: 54px; margin: 0 auto 14px; width: auto; }
.brand-tagline {
  color: var(--white);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 34px 30px;
}
.card-wide { max-width: 960px; }

.card h1 { font-size: 22px; font-weight: 800; color: var(--ink); }
.card h2 { font-size: 17px; font-weight: 700; color: var(--ink); }
.card .sub { color: var(--grey-mid); font-size: 14px; margin-top: 4px; }

/* ---------- Landing choice screen ---------- */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
  max-width: 720px;
}
.choice {
  background: rgba(255, 255, 255, 0.34);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(8, 22, 36, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  padding: 36px 26px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.choice:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.46);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 50px rgba(8, 22, 36, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.choice .icon {
  width: auto; height: 68px; margin: 0 auto 18px; object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(8, 22, 36, 0.20));
}
.choice h3 { font-size: 19px; font-weight: 800; color: #0e2230; text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35); }
.choice p { color: #2f3e49; font-size: 13.5px; margin-top: 6px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--grey-mid);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 14px;
  border: 1.5px solid #d4dade;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(14, 120, 190, 0.15);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .05s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--grey-light); color: var(--ink); }
.btn-ghost:hover { background: #e1e6ea; }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #e7c4c0; }
.btn-danger:hover { background: #fdeceb; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- Alerts ---------- */
.alert {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f4c7c2; }
.alert-success { background: #e9f7ef; color: var(--success); border: 1px solid #bfe6cf; }
.alert-info { background: #eaf4fb; color: var(--blue-dark); border: 1px solid #c2def2; }

/* ---------- App top bar (dashboards) ---------- */
.topbar {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.topbar img { height: 30px; width: auto; }
.topbar .who { font-size: 13.5px; opacity: .85; }
.topbar .who b { opacity: 1; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 22px 60px;
}

/* ---------- Welcome banner ---------- */
.welcome {
  background: linear-gradient(110deg, var(--blue) 0%, var(--blue-darker) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}
.welcome h1 { font-size: 26px; font-weight: 800; }
.welcome p { opacity: .92; margin-top: 6px; font-size: 14.5px; }

/* ---------- Statement / content list ---------- */
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  color: var(--grey-mid);
  margin: 6px 4px 14px;
}
.statement {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  margin-bottom: 16px;
  border-left: 5px solid var(--blue);
}
.statement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.statement h3 { font-size: 16.5px; font-weight: 800; color: var(--ink); }
.statement .date { font-size: 12px; color: var(--grey-mid); white-space: nowrap; }
.statement .msg { margin-top: 8px; color: #36444f; font-size: 14.5px; white-space: pre-wrap; }
.statement .file-row { margin-top: 14px; }

.empty {
  text-align: center;
  color: var(--grey-mid);
  padding: 40px 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.empty .big { font-size: 15px; font-weight: 700; color: var(--ink); }

/* ---------- Admin two-column ---------- */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 24px;
}
.panel h2 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.panel .sub { color: var(--grey-mid); font-size: 13px; margin-bottom: 18px; }

.divider { height: 1px; background: #e6eaed; margin: 18px 0; }

/* small helper text */
.hint { font-size: 12px; color: var(--grey-mid); margin-top: 6px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.back-link { color: #fff; opacity: .85; text-decoration: none; font-size: 13px; font-weight: 600; }
.back-link:hover { opacity: 1; }

/* credentials readout after creating an agent */
.cred-box {
  background: #06283c;
  color: #d8ecfa;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 14px;
  margin-top: 14px;
  word-break: break-word;
}
.cred-box b { color: #fff; }
.cred-box .row { margin: 4px 0; }

/* table of created agents */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mini-table th {
  text-align: left;
  color: var(--grey-mid);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 6px 8px;
  border-bottom: 2px solid #e6eaed;
}
.mini-table td { padding: 8px; border-bottom: 1px solid #eef1f3; }

/* spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-mid);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .choice-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 50px; }
  .welcome { padding: 22px; }
  .welcome h1 { font-size: 22px; }
  .topbar { padding: 12px 16px; }
  .topbar .who { display: none; }
}
