/* ==========================================================================
   Horizons Consultants — Portal & Admin styles (Modern with Animations)
   Reuses the same color tokens as the marketing site (main.css) and adds
   minimal portal-specific layout rules with modern animations.
   ========================================================================== */

/* ======= CSS Animation Keyframes ======= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 4px 15px rgba(15, 46, 92, 0.1); }
  50% { box-shadow: 0 4px 25px rgba(15, 46, 92, 0.2); }
}
@keyframes ripple {
  to { transform: scale(2); opacity: 0; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes tabSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ======= Base Animation Classes ======= */
.animate-fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease forwards; }
.animate-slide-in-right { animation: slideInRight 0.4s ease forwards; }
.animate-slide-in-left { animation: slideInLeft 0.4s ease forwards; }
.animate-scale-in { animation: scaleIn 0.3s ease forwards; }
.animate-tab-slide { animation: tabSlideIn 0.3s ease forwards; }
.animate-toast { animation: toastSlideIn 0.4s ease forwards; }

/* Animation Delays for Staggered Effects */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ======= Loading Skeleton ======= */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  height: 20px;
  margin: 8px 0;
}
.skeleton-text { width: 100%; }
.skeleton-title { height: 30px; width: 60%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }

/* ======= Modern Card Styles ======= */
.portal-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: calc(100px + var(--space-xl, 2rem)) var(--space-xl, 2rem) var(--space-3xl, 4rem);
}

.portal-container {
  max-width: 1100px;
  margin: 0 auto;
}

.portal-card {
  background: #fff;
  border-radius: 20px;
  padding: var(--space-2xl, 2.5rem);
  box-shadow: 0 6px 24px rgba(15, 46, 92, 0.06), 0 2px 8px rgba(15, 23, 42, 0.05);
  border: 1px solid var(--color-border, #e5e7eb);
  border-left: 5px solid var(--color-primary, #0f2e5c);
  margin-bottom: var(--space-xl, 2rem);
  animation: fadeInUp 0.5s ease forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.portal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(15, 46, 92, 0.12), 0 4px 12px rgba(15, 23, 42, 0.08);
}

.portal-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--color-text, #0f172a);
  margin: 0 0 var(--space-sm, 0.75rem);
  letter-spacing: -0.02em;
}

.portal-subtitle {
  color: var(--color-text-muted, #64748b);
  font-size: 1rem;
  margin: 0 0 var(--space-xl, 2rem);
  line-height: 1.6;
}

.portal-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-2xl, 2.5rem);
}

@media (max-width: 800px) {
  .portal-grid { grid-template-columns: 1fr; }
}

.portal-nav {
  background: #fff;
  border-radius: 16px;
  padding: var(--space-lg, 1.5rem);
  border: 1px solid var(--color-border, #e5e7eb);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.portal-nav h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted, #64748b);
  margin: 0 0 var(--space-md, 1rem);
}

.portal-nav a {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--color-text, #0f172a);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.portal-nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(15, 46, 92, 0.1), transparent);
  transition: left 0.5s ease;
}
.portal-nav a:hover::before {
  left: 100%;
}
.portal-nav a:hover { 
  background: rgba(15, 46, 92, 0.06); 
  color: var(--color-primary, #0f2e5c);
  transform: translateX(4px);
}
.portal-nav a.is-active {
  background: var(--color-primary, #0f2e5c);
  color: #fff;
  animation: pulse 2s infinite;
}

.portal-form { display: grid; gap: var(--space-md, 1rem); max-width: 480px; }
.portal-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  margin-bottom: 0.35rem;
}
.portal-form input,
.portal-form select,
.portal-form textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--color-text, #0f172a);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus {
  outline: none;
  border-color: var(--color-primary, #0f2e5c);
  box-shadow: 0 0 0 3px rgba(15, 46, 92, 0.12);
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.portal-btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
}
.portal-btn:active::after {
  animation: ripple 0.6s ease-out;
}
.portal-btn-primary {
  background: var(--color-primary, #0f2e5c);
  color: #fff;
  box-shadow: 0 4px 15px rgba(15, 46, 92, 0.3);
}
.portal-btn-primary:hover { 
  background: var(--color-secondary, #b91c1c); 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4);
}
.portal-btn-primary:active {
  transform: translateY(0);
}
.portal-btn-outline {
  background: transparent;
  color: var(--color-primary, #0f2e5c);
  border: 1.5px solid var(--color-primary, #0f2e5c);
}
.portal-btn-outline:hover { 
  background: var(--color-primary, #0f2e5c); 
  color: #fff;
  transform: translateY(-2px);
}
.portal-btn-danger { 
  background: #b91c1c; 
  color: #fff;
  box-shadow: 0 4px 15px rgba(185, 28, 28, 0.3);
}
.portal-btn-danger:hover { 
  background: #991b1b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4);
}
/* Button Loading State */
.portal-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.portal-btn.loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

.portal-msg { 
  padding: 0.85rem 1rem; 
  border-radius: 10px; 
  margin-bottom: var(--space-md, 1rem); 
  font-size: 0.92rem; 
  animation: toastSlideIn 0.4s ease forwards;
  position: relative;
  overflow: hidden;
}
.portal-msg::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 10px 0 0 10px;
}
.portal-msg-success { 
  background: #ecfdf5; 
  color: #065f46; 
  border: 1px solid #a7f3d0; 
}
.portal-msg-success::before { background: #10b981; }
.portal-msg-error { 
  background: #fef2f2; 
  color: #991b1b; 
  border: 1px solid #fecaca; 
}
.portal-msg-error::before { background: #ef4444; }
.portal-msg-info { 
  background: #eff6ff; 
  color: #1e3a8a; 
  border: 1px solid #bfdbfe; 
}
.portal-msg-info::before { background: #3b82f6; }

.portal-table { 
  width: 100%; 
  border-collapse: separate; 
  border-spacing: 0;
  background: #fff; 
  border-radius: 12px;
  overflow: hidden;
  animation: fadeInUp 0.5s ease forwards;
}
.portal-table th, .portal-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.92rem;
}
.portal-table th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 700;
  color: var(--color-text, #0f172a);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.portal-table tr { 
  transition: all 0.2s ease;
}
.portal-table tbody tr:hover td { 
  background: linear-gradient(90deg, rgba(15, 46, 92, 0.03) 0%, rgba(15, 46, 92, 0.08) 100%);
  transform: translateX(2px);
}
.portal-table tbody tr {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}
/* Staggered animation for table rows */
.portal-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.portal-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.portal-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.portal-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.portal-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.portal-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.portal-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.portal-table tbody tr:nth-child(8) { animation-delay: 0.4s; }

.portal-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.portal-pill-pending { background: #fef3c7; color: #92400e; }
.portal-pill-paid { background: #d1fae5; color: #065f46; }
.portal-pill-failed, .portal-pill-cancelled { background: #fee2e2; color: #991b1b; }
.portal-pill-refunded { background: #e0e7ff; color: #3730a3; }
.portal-pill-admin { background: var(--color-primary, #0f2e5c); color: #fff; }

.portal-empty { padding: var(--space-2xl, 2.5rem); text-align: center; color: var(--color-text-muted, #64748b); }

/* =====================================================
   PREMIUM AUTH LAYOUT — Split Screen
   ===================================================== */
@keyframes authBgMove {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes orb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -60px) scale(1.08); }
  66%       { transform: translate(-30px, 30px) scale(0.95); }
}
@keyframes orb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(-50px, 40px) scale(1.1); }
  70%       { transform: translate(20px, -30px) scale(0.92); }
}
@keyframes orb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(30px, 50px) scale(1.05); }
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 8px 24px rgba(15,46,92,0.18)); }
  50%       { transform: translateY(-6px); filter: drop-shadow(0 16px 32px rgba(15,46,92,0.28)); }
}
@keyframes trustBadgeIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes inputFocusLine {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes panelTextIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes starPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(0.9); }
}

/* Wrap — full viewport split */
.portal-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/images/compliance.webp') center/cover fixed no-repeat;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.portal-auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: blur(8px);
  z-index: 1;
}

/* LEFT PANEL — Brand / Marketing */
.portal-auth-panel {
  display: none !important;
}

/* Animated gradient orbs */
.portal-auth-panel::before,
.portal-auth-panel::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
}
.portal-auth-panel::before {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #b91c1c 0%, transparent 70%);
  top: -120px; right: -100px;
  animation: orb1 12s ease-in-out infinite;
}
.portal-auth-panel::after {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  bottom: -80px; left: -80px;
  animation: orb2 16s ease-in-out infinite;
}

/* Extra orb via JS-free div */
.portal-auth-orb3 {
  position: absolute;
  width: 260px; height: 260px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  top: 50%; left: 40%;
  transform: translate(-50%,-50%);
  animation: orb3 20s ease-in-out infinite;
  pointer-events: none;
}

/* Grid overlay texture */
.portal-auth-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.portal-auth-panel-logo {
  display: block;
  height: 90px;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.portal-auth-panel-headline {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  position: relative;
  z-index: 2;
  animation: panelTextIn 0.8s 0.2s ease both;
}
.portal-auth-panel-headline em {
  font-style: normal;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #f59e0b);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: authBgMove 4s linear infinite;
}

.portal-auth-panel-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin: 0 0 2.5rem;
  max-width: 340px;
  position: relative;
  z-index: 2;
  animation: panelTextIn 0.8s 0.35s ease both;
}

/* Trust badges */
.portal-auth-trust {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  z-index: 2;
  margin-bottom: 2.5rem;
}
.portal-auth-trust-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: trustBadgeIn 0.5s ease forwards;
}
.portal-auth-trust-item:nth-child(1) { animation-delay: 0.5s; }
.portal-auth-trust-item:nth-child(2) { animation-delay: 0.65s; }
.portal-auth-trust-item:nth-child(3) { animation-delay: 0.8s; }

.portal-auth-trust-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}
.portal-auth-trust-text {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  line-height: 1.4;
}
.portal-auth-trust-text strong {
  color: #fff;
  display: block;
  font-weight: 700;
}

/* Star rating */
.portal-auth-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
  animation: panelTextIn 0.8s 0.9s ease both;
  opacity: 0;
}
.portal-auth-stars {
  display: flex;
  gap: 2px;
}
.portal-auth-stars span {
  color: #f59e0b;
  font-size: 1rem;
  animation: starPulse 2.5s ease-in-out infinite;
}
.portal-auth-stars span:nth-child(2) { animation-delay: 0.15s; }
.portal-auth-stars span:nth-child(3) { animation-delay: 0.3s; }
.portal-auth-stars span:nth-child(4) { animation-delay: 0.45s; }
.portal-auth-stars span:nth-child(5) { animation-delay: 0.6s; }
.portal-auth-rating-text {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}

/* RIGHT PANEL — Form */
.portal-auth-form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: transparent;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* Subtle top-right bg shape */
.portal-auth-form-side::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(15,46,92,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.portal-auth-form-side::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(185,28,28,0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.portal-auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  padding: 3rem;
  animation: authCardIn 0.7s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  z-index: 2;
}

/* Mobile logo (hidden on desktop) */
.portal-auth-logo {
  display: none;
  height: 56px;
  margin: 0 auto 2rem;
  filter: none;
}

.portal-auth-card h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: #0a1f3f;
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  text-align: left;
}

.portal-auth-card p.muted {
  text-align: left;
  color: #64748b;
  margin: 0 0 2rem;
  font-size: 0.925rem;
  line-height: 1.6;
}

/* Step indicator (decorative) */
.portal-auth-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15,46,92,0.06);
  border: 1px solid rgba(15,46,92,0.12);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #0f2e5c;
  margin-bottom: 1.25rem;
}
.portal-auth-step::before {
  content: '';
  width: 6px; height: 6px;
  background: #0f2e5c;
  border-radius: 50%;
  display: inline-block;
}

/* Form overrides for auth */
.portal-auth-card .portal-form {
  max-width: none;
  gap: 0;
  display: flex;
  flex-direction: column;
}

.portal-auth-field {
  position: relative;
  margin-bottom: 1.25rem;
}

.portal-auth-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.portal-auth-field input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 3rem;
  font-size: 0.97rem;
  font-family: inherit;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  outline: none;
  box-sizing: border-box;
}

.portal-auth-field input:focus {
  border-color: #0f2e5c;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15,46,92,0.08), 0 1px 3px rgba(0,0,0,0.06);
}

.portal-auth-field input::placeholder {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Icon inside input */
.portal-auth-field-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.25s;
  font-size: 1rem;
  display: flex;
  align-items: center;
}
/* Shift icon up to account for label height */
.portal-auth-field:has(label) .portal-auth-field-icon {
  top: calc(50% + 14px);
}

.portal-auth-field input:focus ~ .portal-auth-field-icon,
.portal-auth-field:focus-within .portal-auth-field-icon {
  color: #0f2e5c;
}

/* Divider */
.portal-auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 1.25rem;
  color: #cbd5e1;
  font-size: 0.75rem;
}
.portal-auth-divider::before,
.portal-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Submit button */
.portal-auth-card .portal-btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #0f2e5c 0%, #1a3d7a 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(15,46,92,0.3), 0 1px 3px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}
.portal-auth-card .portal-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.portal-auth-card .portal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15,46,92,0.35), 0 2px 6px rgba(0,0,0,0.12);
}
.portal-auth-card .portal-btn-primary:hover::before {
  opacity: 1;
}
.portal-auth-card .portal-btn-primary span {
  position: relative;
  z-index: 1;
}
.portal-auth-card .portal-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(15,46,92,0.2);
}

/* Footer links */
.portal-auth-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 2;
}
.portal-auth-footer a {
  color: #0f2e5c;
  font-weight: 700;
  text-decoration: none;
  position: relative;
}
.portal-auth-footer a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: #b91c1c;
  transition: width 0.3s ease;
}
.portal-auth-footer a:hover::after {
  width: 100%;
}
.portal-auth-footer a:hover {
  color: #b91c1c;
}

/* Back to site link */
.portal-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
  margin-top: 0.25rem;
}
.portal-auth-back:hover { color: #0f2e5c; }

/* ---- RESPONSIVE ---- */
@media (max-width: 860px) {
  .portal-auth-wrap {
    grid-template-columns: 1fr;
  }
  /* Left panel always hidden now */
  .portal-auth-form-side {
    min-height: 100vh;
    padding: 2.5rem 1.5rem;
    justify-content: flex-start;
    padding-top: 3rem;
  }
  .portal-auth-logo {
    display: block;
  }
  .portal-auth-card h1 {
    font-size: 1.6rem;
    text-align: center;
  }
  .portal-auth-card p.muted {
    text-align: center;
  }
  .portal-auth-step {
    display: none;
  }
}

.portal-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding: 0.85rem var(--space-xl, 2rem);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.portal-topbar a.brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--color-primary, #0f2e5c); font-weight: 700; }
.portal-topbar img { height: 76px; }
.portal-topbar .topbar-right { display: flex; align-items: center; gap: var(--space-md, 1rem); font-size: 0.9rem; color: var(--color-text-muted, #64748b); }
.portal-topbar .topbar-right a { color: var(--color-primary, #0f2e5c); text-decoration: none; font-weight: 600; }

.doc-list { display: grid; gap: 0.75rem; }
.doc-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1rem; background: #f8fafc; border-radius: 10px;
  border: 1px solid var(--color-border, #e5e7eb);
  transition: all 0.3s ease;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}
.doc-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(15, 46, 92, 0.1);
}
.doc-item .doc-meta { font-size: 0.78rem; color: var(--color-text-muted, #64748b); margin-top: 0.2rem; }
.doc-item .doc-actions { display: flex; gap: 0.5rem; }

/* ======= Admin Dashboard Specific Styles ======= */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.admin-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}
.admin-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at top right, rgba(15, 46, 92, 0.05), transparent 70%);
  border-radius: 0 1rem 0 0;
}
.admin-card:nth-child(1) { animation-delay: 0.1s; }
.admin-card:nth-child(2) { animation-delay: 0.2s; }
.admin-card:nth-child(3) { animation-delay: 0.3s; }
.admin-card:nth-child(4) { animation-delay: 0.4s; }
.admin-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(15, 46, 92, 0.15);
  border-color: var(--color-primary, #0f2e5c);
}
.admin-card h3 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  color: var(--color-primary, #0f2e5c);
  font-weight: 800;
  animation: countUp 0.6s ease forwards;
  display: inline-block;
}
.admin-card p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}
.admin-badge:hover { transform: scale(1.05); }
.admin-badge-admin {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.2);
}
.admin-badge-user {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  box-shadow: 0 2px 8px rgba(55, 65, 81, 0.15);
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  border-radius: 12px;
  overflow: hidden;
}
.admin-table th {
  background: linear-gradient(180deg, #0f2e5c 0%, #1e3a8a 100%);
  color: #fff;
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  transition: all 0.2s ease;
}
.admin-table tbody tr { transition: all 0.2s ease; }
.admin-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(15, 46, 92, 0.02) 0%, rgba(15, 46, 92, 0.06) 100%);
}
.admin-nav a.is-active {
  color: #b91c1c;
  font-weight: 700;
  position: relative;
}
.admin-nav a.is-active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: #b91c1c;
  border-radius: 3px;
}

.admin-btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}
.admin-btn-sm:hover {
  background: #0f2e5c;
  color: #fff;
  border-color: #0f2e5c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 46, 92, 0.2);
}

.admin-doc-status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}
.admin-doc-status:hover { transform: scale(1.05); }
.admin-doc-status-pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  box-shadow: 0 2px 8px rgba(146, 64, 14, 0.2);
}
.admin-doc-status-approved {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.2);
}
.admin-doc-status-not_approved {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  box-shadow: 0 2px 8px rgba(153, 27, 27, 0.2);
}
.admin-doc-status-reupload {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.2);
}
.admin-doc-notes {
  width: 100%;
  min-width: 160px;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #fafafa;
}
.admin-doc-notes:focus {
  outline: none;
  border-color: #0f2e5c;
  box-shadow: 0 0 0 3px rgba(15, 46, 92, 0.1);
  background: #fff;
}

/* ======= Tab Transitions ======= */
.js-tab {
  animation: fadeInUp 0.3s ease forwards;
}
.js-tab[hidden] {
  display: none;
}

/* ======= Responsive Enhancements ======= */
/* OTP animation + UI */
.portal-otp-section {
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
  overflow: hidden;
  transition: max-height 0.45s ease, opacity 0.35s ease, transform 0.45s ease;
  will-change: max-height, opacity, transform;
}
.portal-otp-section.is-visible {
  max-height: 420px;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.portal-otp-meta {
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.25rem 0 1rem;
}
.portal-otp-timer {
  font-family: inherit;
  font-weight: 800;
  color: var(--color-primary, #0f2e5c);
  background: rgba(15,46,92,0.06);
  border: 1px solid rgba(15,46,92,0.12);
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  min-width: 120px;
  text-align:center;
}
.portal-otp-resend {
  font-size: 0.9rem;
  color: #64748b;
  display:flex;
  align-items:center;
  gap: 0.5rem;
}
.portal-link-btn {
  background: transparent;
  border: none;
  color: var(--color-primary, #0f2e5c);
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}
.portal-link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}
.portal-otp-actions {
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .admin-card {
    padding: 1rem;
  }
  .admin-card h3 {
    font-size: 1.5rem;
  }
  .portal-card {
    padding: 1.5rem;
    border-radius: 12px;
  }
  .portal-table {
    font-size: 0.8rem;
  }
  .portal-table th, .portal-table td {
    padding: 0.6rem 0.5rem;
  }
}
