/* Auth pages */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--navy);
}

/* LEFT — brand panel */
.auth-right {
  display: flex;
  justify-content: center;
  align-items: flex-start;   /* CHANGE this */
  padding-top: 90px;         /* ADD this */
}
.auth-brand {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,252,.98) 100%);
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(15,23,42,.03);
  display: flex;
  flex-direction: column;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute; bottom: -100px; left: -80px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,.12) 0%, transparent 70%);
  pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-logo { margin-bottom: auto; }
.brand-logo-mark {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 64px;
}
.brand-logo-icon {
  width: 44px; height: 44px;
  background: var(--amber);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
  color: var(--ink);
}
.brand-logo-text { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--white); }
.brand-logo-text span { color: var(--amber); }

.auth-brand-content { position: relative; z-index: 1; }
.auth-brand-content h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 16px;
}
.auth-brand-content h1 span { color: var(--amber); }
.auth-brand-content p { font-size: 1rem; color: var(--slate-400); line-height: 1.7; max-width: 380px; }

.auth-features { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.auth-feature {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  animation: fadeInUp .5s ease both;
}
.auth-feature:nth-child(1) { animation-delay: .1s; }
.auth-feature:nth-child(2) { animation-delay: .2s; }
.auth-feature:nth-child(3) { animation-delay: .3s; }
.auth-feature-icon {
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.auth-feature-text h4 { font-size: .88rem; margin-bottom: 2px; }
.auth-feature-text p { font-size: .78rem; color: var(--slate-400); }

.auth-stats { display: flex; gap: 32px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.auth-stat-val { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--white); }
.auth-stat-label { font-size: .75rem; color: var(--slate-400); }

/* ── Mobile-only auth brand header ── */
.auth-mobile-brand {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px 0;
  margin-bottom: 40px;
  animation: fadeInUp .4s ease both;
}
.auth-mobile-brand .amb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.auth-mobile-brand .amb-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.auth-mobile-brand .amb-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--white);
}
.auth-mobile-brand .amb-logo-text span {
  color: var(--amber);
}
.auth-mobile-brand .amb-tagline {
  font-size: .82rem;
  color: var(--slate-400);
  max-width: 280px;
  line-height: 1.5;
}

/* RIGHT — form panel */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-header { margin-bottom: 32px; }
.auth-form-header h2 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-form-header p { font-size: .9rem; color: var(--slate-400); }

/* Role selector */
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px;
  background: var(--navy-700);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--trans);
  text-align: center;
}
.role-card:hover { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.05); }
.role-card.selected { border-color: var(--amber); background: rgba(245,158,11,.1); }
.role-card .role-icon { font-size: 1.8rem; }
.role-card .role-name { font-size: .82rem; font-weight: 600; color: var(--white); }
.role-card .role-desc { font-size: .7rem; color: var(--slate-400); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--slate-400); font-size: .8rem; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-link { font-size: .875rem; text-align: center; color: var(--slate-400); margin-top: 20px; }
.auth-link a { color: var(--amber); font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }

.forgot-link { font-size: .78rem; color: var(--amber); font-weight: 500; }
.forgot-link:hover { text-decoration: underline; }

.password-toggle {
  position: relative;
}
.password-toggle .form-input { padding-right: 44px; }
.toggle-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  z-index: 2;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none; border: none; color: var(--slate-400); font-size: .9rem; cursor: pointer;
  transition: color var(--trans);
}
.toggle-eye:hover { color: var(--white); }

.strength-bar { display: flex; gap: 4px; margin-top: 6px; }
.strength-seg { flex: 1; height: 3px; border-radius: 2px; background: rgba(15,23,42,.10); transition: background .3s; }
.strength-seg.weak   { background: var(--red); }
.strength-seg.fair   { background: var(--amber); }
.strength-seg.strong { background: var(--green); }

.terms-check { display: flex; align-items: flex-start; gap: 10px; font-size: .82rem; color: var(--slate-400); }
.terms-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.terms-check a { color: var(--amber); }

/* Landing page (index.html) */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}
.landing::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245,158,11,.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59,130,246,.06), transparent);
  pointer-events: none;
}
.landing-logo {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 48px;
  animation: fadeInUp .5s ease both;
}
.landing-icon {
  width: 56px; height: 56px;
  background: var(--amber);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.6rem;
  color: var(--ink);
}
.landing-title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--white); }
.landing-title span { color: var(--amber); }

.landing h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  max-width: 700px;
  margin-bottom: 16px;
  animation: fadeInUp .5s .1s ease both;
}
.landing h1 span { color: var(--amber); }
.landing > p {
  font-size: 1.1rem; text-align: center; max-width: 520px;
  margin-bottom: 48px;
  animation: fadeInUp .5s .2s ease both;
}

.portal-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1020px;
  margin: 56px auto 0;
  animation: fadeInUp .5s .3s ease both;
}
.portal-card {
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,252,.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  display: flex; flex-direction: column; gap: 16px;
  cursor: pointer;
  min-height: 250px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
  text-decoration: none;
  position: relative; overflow: hidden;
}
.portal-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(245,158,11,.08) 0%, transparent 62%);
  opacity: 0; transition: opacity var(--trans);
}
.portal-card::after {
  content: '';
  position: absolute;
  inset: auto 28px 0 28px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(245,158,11,.85), rgba(245,158,11,.18));
  opacity: .75;
}
.portal-card:hover { transform: translateY(-6px); border-color: rgba(245,158,11,.28); box-shadow: var(--shadow-lg); }
.portal-card:hover::before { opacity: 1; }
.portal-card.featured {
  transform: translateY(-10px);
  border-color: rgba(245,158,11,.30);
  box-shadow: var(--shadow-lg);
}
.portal-card.featured:hover {
  transform: translateY(-14px);
}
.portal-card .portal-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(245,158,11,.14) 0%, rgba(245,158,11,.08) 100%);
  color: var(--white);
  border: 1px solid rgba(245,158,11,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.portal-card .portal-icon .material-symbols-outlined {
  font-size: 28px;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
}
.portal-card h3 { font-size: 1.2rem; }
.portal-card p { font-size: .88rem; color: var(--slate-400); max-width: 26ch; }
.portal-card .portal-link {
  color: #B45309;
  font-size: .86rem;
  font-weight: 700;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.portal-card:hover .portal-link span { transform: translateX(4px); transition: transform var(--trans); }
.portal-card .portal-meta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.05);
  color: var(--slate-400);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.landing-admin-link {
  margin-top: 32px;
  font-size: .8rem;
  color: var(--navy-500);
}
.landing-admin-link a {
  color: var(--amber);
  font-weight: 600;
}
.landing-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

@media (max-width: 768px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-form-panel { padding: 24px 20px; justify-content: flex-start; }
  .auth-form-wrap { max-width: 100%; }
  .auth-form-header h2 { font-size: 1.4rem; }

  /* Forms — touch-friendly */
  .auth-form .form-input {
    min-height: 48px;
    font-size: .95rem;
  }
  .auth-form .btn {
    min-height: 48px;
    font-size: .95rem;
  }
  .role-selector { gap: 8px; }
  .role-card { padding: 14px 10px; }
  .role-card .role-icon { font-size: 1.5rem; }
  .role-card .role-name { font-size: .78rem; }

  /* Landing page */
  .landing { padding: 32px 16px; }
  .landing h1 { font-size: clamp(1.5rem, 6vw, 2.2rem) !important; }
  .landing > p { font-size: .92rem; margin-bottom: 32px; }
  .landing-logo { margin-bottom: 32px; }

  /* Portal cards — single column */
  .portal-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
    gap: 16px;
    margin-top: 32px;
  }
  .portal-card {
    min-height: auto;
    padding: 22px 20px;
  }
  .portal-card.featured { transform: none; }
  .portal-card.featured:hover { transform: translateY(-4px); }
  .portal-card p { max-width: 100%; }
  .portal-card .portal-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
  }
  .portal-card .portal-icon .material-symbols-outlined { font-size: 24px; }
  .portal-card h3 { font-size: 1.05rem; }

  .landing-admin-link { margin-top: 24px; }
}

@media (max-width: 400px) {
  .auth-form-panel { padding: 24px 16px; }
  .landing { padding: 24px 12px; }
  .portal-cards { max-width: 100%; gap: 12px; }
  .portal-card { padding: 18px 16px; }
}

.logo-img, .brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}