/* NomadID branded theme for the TAK Self-Enrollment Portal.
 *
 * Palette sampled directly from logo.png — six gradient stops between
 * #660CFA (violet, left edge) and #23EA98 (mint, right edge), with an
 * inner dark surface at #1D063B.
 *
 * Strategy:
 *
 *   - Light page background (#FAFAF8) keeps the portal readable in any
 *     ambient lighting; the logo provides all the dark-mode flavor.
 *   - Primary action color is the leftmost violet — punchy on white,
 *     distinctive against TAK Server's other touchpoints.
 *   - The full gradient becomes a decorative top border on every card
 *     (echoes the logo's border treatment) and the qr-wrap outline.
 *   - Mint green is reserved for "success" + the CAC card (visual
 *     parity with the logo's right-hand color).
 *
 * Cascade order: this file loads AFTER styles.css, so every
 * --variable override here wins. The non-variable rules at the bottom
 * (gradient borders, logo treatment) are additive — they don't replace
 * default styles, just add NomadID-specific flourishes.
 */

:root {
  /* ─── Brand colors (sampled from logo.png) ───────────────────────── */
  --accent:           #660CFA;   /* logo gradient stop #1 — primary action */
  --accent-hover:     #5208c9;   /* darkened ~15% for hover */
  --accent-soft-bg:   #F3EEFE;   /* very pale violet tint */
  --accent-soft-bdr:  #D6C2FB;
  --accent-info-bg:   #EEE8FE;
  --brand-mint:       #23EA98;   /* logo gradient stop #6 — success/CAC */
  --brand-mint-soft:  #E6FBF1;
  --brand-mint-bdr:   #A6F0CC;
  --brand-cyan:       #3E91BF;   /* logo gradient stop #4 — secondary accent */
  --brand-indigo:     #4B65D3;   /* logo gradient stop #3 */
  --brand-dark:       #1D063B;   /* logo inner fill — header/footer surfaces */
  --secondary:        #5b5b6d;   /* muted but still on-brand cool gray */
  --error:            #c0392b;

  /* Override the base CAC card to use mint (matching the logo's right edge) */
  --success:          var(--brand-mint-soft);
  --success-bdr:      var(--brand-mint-bdr);

  /* ─── Surface / chrome ─────────────────────────────────────────── */
  --bg-page:          #FAFAF8;
  --bg-code:          #EEEBF3;     /* slight purple cast on code blocks */
  --text-primary:     #1A1730;     /* deep blue-purple instead of pure black */
  --text-secondary:   #555066;
  --text-muted:       #7a7385;
  --text-on-accent:   #FFFFFF;
  --border-default:   #E2DEEC;

  /* ─── Typography ────────────────────────────────────────────────── */
  /* The NomadID wordmark is a rounded geometric sans. Closest free web
   * fallbacks: Nunito, Quicksand, Comfortaa, Mulish. Inter is a safe
   * generic. We lead with system-ui so we don't drag a web font into
   * an air-gapped deployment, with explicit named fonts as fallbacks
   * for environments that ship them. */
  --font-stack:       "Inter", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:        "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-size-base:   1rem;

  /* ─── Spacing / shape ──────────────────────────────────────────── */
  --radius-card:      0.75rem;
  --radius-button:    0.5rem;

  /* ─── Branded gradient (used in additive rules below) ─────────── */
  --brand-gradient:   linear-gradient(
                        90deg,
                        #660CFA  0%,
                        #5838E6 20%,
                        #4B65D3 40%,
                        #3E91BF 60%,
                        #31BDAC 80%,
                        #23EA98 100%
                      );
}

/* ─── Three-up brand bar ──────────────────────────────────────────────
 *
 * Co-branded header pattern matching TacticalID: a flanking emblem on
 * each side of the center NomadID wordmark. Default deploy renders:
 *
 *   ┌─────────┐   ┌────────────────────────┐   ┌─────────┐
 *   │ MCHMR   │   │       NomadID          │   │ MCTSSA  │
 *   │ shield  │   │       wordmark         │   │  seal   │
 *   └─────────┘   └────────────────────────┘   └─────────┘
 *
 * Either flank slot collapses gracefully if its metadata URL is empty.
 * On narrow viewports (<480px) the bar wraps so the center mark sits
 * above the flanking emblems.
 */

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0 0 2rem 0;
  padding: 1rem 0;
}

.brand-bar .brand-logo {
  /* Center mark: NomadID wordmark — render bigger than the flanks so the
   * product name is the visual anchor. Responsive: scales up on wide 16:9
   * displays, capped so it never exceeds the 1098x300 source (stays sharp). */
  height: clamp(3.5rem, 6vw, 6rem);
  max-width: 100%;
  width: auto;
  margin: 0;
  filter: drop-shadow(0 2px 8px rgba(29, 6, 59, 0.12));
}

.brand-bar .brand-emblem {
  /* Flanking emblems: responsive, sized a touch taller than the wordmark so
   * the detailed shield reads clearly. Equal height regardless of source
   * aspect ratio (shield vs. round seal). */
  height: clamp(5rem, 7.5vw, 7rem);
  width: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(29, 6, 59, 0.18));
  transition: transform 0.2s ease;
}

.brand-bar .brand-emblem:hover {
  transform: translateY(-1px) scale(1.02);
}

/* Backwards-compatible: when there's no .brand-bar wrapper (legacy
 * single-logo render path), preserve the standalone treatment. */
body > .brand-logo {
  height: 3.5rem;
  max-width: 100%;
  width: auto;
  margin: 0 0 1.5rem 0;
  filter: drop-shadow(0 2px 8px rgba(29, 6, 59, 0.12));
}

/* Narrow viewport — center brand mark stacks above the emblems. */
@media (max-width: 480px) {
  .brand-bar {
    gap: 0.75rem;
  }
  .brand-bar .brand-logo {
    flex-basis: 100%;
    height: 3rem;
  }
  .brand-bar .brand-emblem {
    height: 4rem;
  }
}

/* ─── Header / title typography ───────────────────────────────────── */

h1 {
  /* The logo already carries the brand voice. Make the h1 quieter so
   * the eye lands on the logo first. */
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 0.25rem;
  margin-bottom: 2rem;
}

/* ─── Gradient accents on cards ───────────────────────────────────────
 * Each card gets a 3px gradient strip at the top — echoes the logo's
 * gradient border treatment. Implemented via border-image so it works
 * without nested elements. */

.card {
  position: relative;
  border: 1px solid var(--border-default);
  border-top-width: 3px;
  border-top-style: solid;
  border-image: var(--brand-gradient) 1;
  border-image-slice: 1;
  /* Keep the other three borders solid + neutral. border-image styles
   * all four edges by default; this hack restores the side/bottom
   * borders by layering a pseudo-element behind the card. */
  background-clip: padding-box;
}

.card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 0;
  color: var(--text-primary);
}

/* SSO card stays violet-tinted; CAC card uses mint to mirror the
 * gradient's right edge. */
.card.sso {
  background: var(--accent-soft-bg);
}
.card.cac {
  background: var(--brand-mint-soft);
}

/* ─── Buttons ────────────────────────────────────────────────────────
 * Primary buttons: solid violet. On hover, animate a subtle gradient
 * sweep — feels alive without being noisy. */

.button {
  background: var(--accent);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-position 0.4s ease, transform 0.1s ease, box-shadow 0.2s ease;
  background-size: 200% 100%;
  background-position: 0% 50%;
  box-shadow: 0 2px 6px rgba(102, 12, 250, 0.18);
}

.button:hover {
  background: var(--brand-gradient);
  background-size: 200% 100%;
  background-position: 100% 50%;
  box-shadow: 0 4px 14px rgba(102, 12, 250, 0.28);
}

.button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(102, 12, 250, 0.2);
}

.button.secondary {
  background: var(--secondary);
  box-shadow: none;
}
.button.secondary:hover {
  background: #4a4658;
}

/* ─── QR wrapper — gradient outline matching the logo ─────────────── */

.qr-wrap {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg-page), var(--bg-page)) padding-box,
    var(--brand-gradient) border-box;
  border-radius: var(--radius-card);
  padding: 0.75rem;
}

.qr-tab.active {
  background: var(--accent);
  border-color: var(--accent);
}

/* ─── Security callout — branded soft tint ──────────────────────── */

.security {
  background: var(--accent-info-bg);
  border-left: 4px solid var(--accent);
}

/* ─── Footer gradient bar (subtle on-brand divider) ─────────────── */

body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--brand-gradient);
  z-index: 100;
}

/* ─── Full-page background watermark (nomad / mountains line art) ──────
 * Faded ~12% PNG (white knocked to transparent) painted on <html> so it
 * spans the whole viewport; <body> is made transparent so the watermark
 * shows through the centered content column too. Fixed + cover keeps it
 * still while the page scrolls. Tune strength by regenerating nomad_bg.png
 * (the alpha multiply) — no CSS change needed. */
html {
  background-color: var(--bg-page);
  background-image: url("/portal/assets/nomad_bg.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
}
body {
  background: transparent;
}
