/* ═══════════════════════════════════
   BRAND TOKENS
═══════════════════════════════════ */
:root {
  --brand-start:   #1B75BB;
  --brand-mid-1:   #197ABF;
  --brand-mid-2:   #1287CC;
  --brand-mid-3:   #079EE0;
  --brand-end:     #00ADEE;

  --brand-dark:    #0F5A96;
  --brand-deep:    #0A3F6E;
  --brand-dim:     rgba(0,173,238,0.10);
  --brand-glow:    rgba(0,173,238,0.22);
  --brand-border:  rgba(0,173,238,0.28);

  --grad-brand:   linear-gradient(90deg, #1B75BB 0%, #197ABF 25%, #1287CC 54%, #079EE0 84%, #00ADEE 100%);
  --grad-brand-d: linear-gradient(135deg, #1B75BB 0%, #00ADEE 100%);

  --charcoal:    #231F20;
  --charcoal-2:  #3A3637;
  --charcoal-3:  #5C5759;

  --shell:       #0C1A2E;
  --shell-2:     #112240;
  --shell-3:     #16304F;
  --shell-4:     #1E3D5C;

  --off-white:   #F5F7FA;
  --white:       #FFFFFF;
  --light-border:#DDE3EC;
  --light-muted: #8A97A8;
  --light-text:  #2E3A4A;

  --success:     #17A754;
  --danger:      #D93025;
  --warning:     #D18B0F;

  --font-display: 'Syne', sans-serif;
  --font-body:    'IBM Plex Sans', 'Noto Sans Arabic', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* ── Semantic aliases — used throughout portal components ── */
  --surface:        var(--white);
  --border:         var(--light-border);
  --text-primary:   var(--light-text);
  --text-secondary: var(--light-muted);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--charcoal);
  background: var(--shell);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
button { font-family: var(--font-body); cursor: pointer; }
input, select { font-family: var(--font-body); }
a { text-decoration: none; }

/* ═══════════════════════════════════
   FORM CONTROLS
   (shared by auth and portal pages)
═══════════════════════════════════ */
.field-block { margin-bottom: 18px; }
.field-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--light-muted); margin-bottom: 6px;
  letter-spacing: 0.07em; text-transform: uppercase;
}
.field-label-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
/* Reset label margin when it lives inside a flex row */
.field-label-row .field-label { margin-bottom: 0; }
.field-wrap { position: relative; }
.field-pfx {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: #9BAAB8; font-size: 16px; pointer-events: none; line-height: 1;
}
.field-sfx {
  position: absolute; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; padding: 0 13px;
  cursor: pointer; background: none; border: none;
  color: #9BAAB8; font-size: 15px; transition: color 0.15s;
}
.field-sfx:hover { color: var(--light-text); }
.field {
  width: 100%; height: 50px; padding: 0 13px 0 42px;
  border: 1.5px solid var(--light-border);
  border-radius: var(--radius); font-size: 14px;
  color: var(--light-text); background: var(--white);
  outline: none; transition: border-color 0.18s, box-shadow 0.18s;
  font-family: var(--font-body);
}
.field:focus {
  border-color: var(--brand-mid-2);
  box-shadow: 0 0 0 3px rgba(18,135,204,0.14);
}
.field.no-pfx { padding-left: 13px; }
.field.has-sfx { padding-right: 42px; }

/* Checkbox */
.check-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: #5A6877; cursor: pointer;
}
.check-row input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--brand-mid-2); cursor: pointer;
}

/* Alert banner */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 18px; border: 1px solid;
  line-height: 1.5;
}
.alert-err  { background: rgba(217,48,37,0.07); border-color: rgba(217,48,37,0.22); color: var(--danger); }
.alert-ok   { background: rgba(23,167,84,0.07); border-color: rgba(23,167,84,0.22); color: var(--success); }
.alert-info { background: var(--brand-dim); border-color: var(--brand-border); color: var(--brand-mid-2); }

/* ═══════════════════════════════════
   AUTH SHELL
═══════════════════════════════════ */
.auth-wrap {
  min-height: 100vh; display: grid;
  grid-template-columns: 1fr 460px;
}

.auth-left {
  background: var(--shell-2);
  display: flex; flex-direction: column; padding: 44px 52px;
  position: relative; overflow: hidden;
}
.auth-left-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-left-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}
.auth-left-glow {
  position: absolute; right: -10%; bottom: -10%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,173,238,0.07) 0%, transparent 70%);
}
.auth-brand-line {
  position: absolute; left: 0; right: 0;
  height: 1px; background: var(--grad-brand); opacity: 0.18;
}
.auth-brand-line.top { top: 96px; }
.auth-brand-line.bot { bottom: 96px; }

/* ── Auth branding header ── */
.auth-logo-wrap     { position: relative; z-index: 2; }
.auth-logo-wordmark {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: -0.5px;
}
.auth-logo-tag {
  font-size: 11px; color: rgba(255,255,255,0.35);
  font-family: var(--font-mono); letter-spacing: 0.1em;
  text-transform: uppercase; margin-left: 10px;
}

.auth-left-content {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; position: relative; z-index: 2;
  padding-top: 40px;
}
.auth-tagline {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -0.8px; color: #fff;
  margin-bottom: 16px;
}
.auth-tagline .grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-tagline-sub { font-size: 14px; color: rgba(255,255,255,0.45); line-height: 1.7; max-width: 380px; margin-bottom: 32px; }
.auth-feat-list { display: flex; flex-direction: column; gap: 12px; }
.auth-feat { display: flex; align-items: flex-start; gap: 11px; }
.auth-feat-chk {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-dim); border: 1px solid var(--brand-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--brand-end); flex-shrink: 0; margin-top: 2px;
}
.auth-feat-text { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.5; }
.auth-feat-text strong { color: rgba(255,255,255,0.82); font-weight: 500; }

.auth-widget {
  margin-top: 36px;
  background: rgba(10,20,36,0.65);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px; padding: 14px 16px;
  backdrop-filter: blur(10px);
}
.auth-widget-top {
  display: flex; justify-content: space-between;
  margin-bottom: 10px;
}
.auth-widget-label { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.3); letter-spacing: 0.09em; text-transform: uppercase; }
.auth-widget-live { display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; color: #28C840; }
.auth-widget-live-dot { width: 5px; height: 5px; border-radius: 50%; background: #28C840; animation: pulse-dot 2s infinite; }
.auth-widget-stats { display: flex; gap: 22px; }
.auth-widget-stat-val { font-family: var(--font-mono); font-size: 19px; font-weight: 500; background: var(--grad-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-widget-stat-lbl { font-size: 10px; color: rgba(255,255,255,0.28); }

.auth-right {
  background: var(--off-white);
  display: flex; flex-direction: column;
  padding: 44px 48px; position: relative;
}
.auth-right-logo { margin-bottom: 40px; }
.auth-right-header { margin-bottom: 28px; }
.auth-h1 {
  font-family: var(--font-display); font-size: 24px;
  font-weight: 800; color: var(--charcoal);
  letter-spacing: -0.4px; margin-bottom: 7px;
}
.auth-sub { font-size: 13px; color: var(--light-muted); line-height: 1.6; }
.auth-sub a { color: var(--brand-mid-2); font-weight: 600; cursor: pointer; }
.auth-sub a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ── Auth form layout helpers ── */
.auth-form-center { margin-top: auto; margin-bottom: auto; }
.auth-ssl-note    { margin-bottom: 20px; }
.auth-ssl-text    { font-size: 11px; color: #B0BBCA; display: flex; align-items: center; gap: 4px; }

.auth-btn {
  width: 100%; height: 50px;
  background: var(--grad-brand);
  color: #fff; font-size: 14px; font-weight: 700;
  border: none; border-radius: var(--radius);
  cursor: pointer; letter-spacing: 0.02em;
  transition: all 0.18s;
  box-shadow: 0 4px 18px var(--brand-glow);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover    { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,173,238,0.38); filter: brightness(1.05); }
.auth-btn:active   { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.forgot-link {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--light-muted);
  font-family: var(--font-body); padding: 0;
  transition: color 0.15s;
}
.forgot-link:hover { color: var(--brand-mid-2); }

.auth-footer-note {
  margin-top: auto; padding-top: 24px;
  font-size: 12px; color: #B0BBCA; text-align: center;
}
.auth-footer-note a { color: #8A97A8; cursor: pointer; }

/* Spinner (shared by auth loading and portal page loading) */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}

/* ═══════════════════════════════════
   ANIMATIONS
═══════════════════════════════════ */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════
   BLAZOR OVERRIDES
═══════════════════════════════════ */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 12px; margin-top: 4px; }

.blazor-error-boundary {
  background: var(--danger);
  padding: 1rem;
  color: white;
}
#blazor-error-ui {
  background: var(--danger);
  padding: 0.5rem 1rem;
  color: white;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  display: none;
}


.btn-ghost {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.75);
}

    .btn-ghost:hover {
        background: rgba(255,255,255,0.11);
        color: #fff;
    }
