/* Portal Auth (production-ready static CSS)
   Keeps /login and /signup independent of components_templetes. */

:root {
  --auth-border-grad: linear-gradient(135deg, #071433 0%, #0B1A4A 35%, #1D4ED8 70%, #0EA5E9 100%);
  --auth-surface-light: linear-gradient(135deg,
    rgba(255,255,255,0.94) 0%,
    rgba(239,246,255,0.92) 38%,
    rgba(224,231,255,0.88) 70%,
    rgba(186,230,253,0.84) 100%);
  --auth-surface-dark: linear-gradient(135deg,
    rgba(31,33,40,0.92) 0%,
    rgba(17,24,39,0.92) 55%,
    rgba(2,6,23,0.90) 100%);
}

/* Floating Theme FAB */
#global-theme-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #E8EDF2;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -4px rgba(0,0,0,.10);
  padding: 0;
}
html.dark #global-theme-fab {
  background: #1F2128;
  border-color: #313442;
}

/* Animated background (glow + grid + bubbles) */
#global-animated-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }

/* Put the actual page content above the background without touching the FAB positioning */
.auth-layer { position: relative; z-index: 1; }

#global-animated-bg .bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(178,167,255,0.22), rgba(178,167,255,0.00) 55%),
    radial-gradient(circle at 80% 60%, rgba(178,167,255,0.18), rgba(178,167,255,0.00) 60%);
  opacity: 0.9;
}

#global-animated-bg .bg-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(178,167,255,0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(178,167,255,0.22) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(circle at 25% 20%, rgba(0,0,0,0.92), rgba(0,0,0,0.14) 62%, transparent 80%);
          mask-image: radial-gradient(circle at 25% 20%, rgba(0,0,0,0.92), rgba(0,0,0,0.14) 62%, transparent 80%);
}

html.dark #global-animated-bg .bg-glow {
  background:
    radial-gradient(circle at 20% 15%, rgba(99,102,241,0.20), rgba(99,102,241,0.00) 58%),
    radial-gradient(circle at 80% 60%, rgba(99,102,241,0.16), rgba(99,102,241,0.00) 62%);
  opacity: 0.75;
}
html.dark #global-animated-bg .bg-grid {
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(99,102,241,0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.26) 1px, transparent 1px);
}

#global-animated-bg .bg-bubble {
  position: absolute;
  bottom: -140px;
  left: var(--left);
  width: var(--size);
  height: var(--size);
  border-radius: 9999px;
  opacity: var(--op);
  background: radial-gradient(circle at 30% 30%,
    rgba(255,255,255,0.80),
    rgba(178,167,255,0.38) 40%,
    rgba(178,167,255,0.00) 72%);
  animation: bubbleFloat var(--dur) linear infinite;
  animation-delay: var(--delay);
}
html.dark #global-animated-bg .bg-bubble {
  background: radial-gradient(circle at 30% 30%,
    rgba(255,255,255,0.14),
    rgba(99,102,241,0.26) 42%,
    rgba(99,102,241,0.00) 74%);
}
@keyframes bubbleFloat {
  0%   { transform: translateY(0) translateX(0) scale(0.95); opacity: var(--op); }
  70%  { opacity: var(--op); }
  100% { transform: translateY(-125vh) translateX(var(--drift)) scale(1.18); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #global-animated-bg .bg-bubble { animation: none; }
}

/* Card styles */
.login-card-border {
  background: var(--auth-border-grad);
  padding: 2px;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(11, 26, 74, 0.20);
}
.login-card-surface {
  border-radius: 22px;
  background: var(--auth-surface-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(11, 26, 74, 0.08);
}
html.dark .login-card-surface {
  background: var(--auth-surface-dark);
  box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.20);
}

/* Input readability */
.login-card-surface input,
.login-card-surface textarea,
.login-card-surface select {
  color: #0F172A !important;
  caret-color: #0F172A !important;
}
.login-card-surface input::placeholder,
.login-card-surface textarea::placeholder {
  color: rgba(15, 23, 42, 0.55) !important;
}
html.dark .login-card-surface input,
html.dark .login-card-surface textarea,
html.dark .login-card-surface select {
  color: #ffffff !important;
  caret-color: #ffffff !important;
}
html.dark .login-card-surface input::placeholder,
html.dark .login-card-surface textarea::placeholder {
  color: rgba(255, 255, 255, 0.60) !important;
}

.input-shell {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.03);
  padding: 12px 14px;
  min-height: 48px;
  display: flex;
  align-items: center;
}
html.dark .input-shell {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(2, 6, 23, 0.35);
}
.input-shell input {
  width: 100%;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  font-size: 14px;
  line-height: 20px;
  padding: 0 !important;
  border-radius: 12px;
}

/* Autofill fixes */
.input-shell input:-webkit-autofill,
.input-shell input:-webkit-autofill:hover,
.input-shell input:-webkit-autofill:focus,
.input-shell input:-webkit-autofill:active {
  -webkit-text-fill-color: inherit !important;
  transition: background-color 99999s ease-out 0s;
  -webkit-box-shadow: 0 0 0px 1000px rgba(2, 6, 23, 0.03) inset !important;
          box-shadow: 0 0 0px 1000px rgba(2, 6, 23, 0.03) inset !important;
  caret-color: inherit;
}
html.dark .input-shell input:-webkit-autofill,
html.dark .input-shell input:-webkit-autofill:hover,
html.dark .input-shell input:-webkit-autofill:focus,
html.dark .input-shell input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0px 1000px rgba(2, 6, 23, 0.35) inset !important;
          box-shadow: 0 0 0px 1000px rgba(2, 6, 23, 0.35) inset !important;
  caret-color: #ffffff !important;
}

/* Fixed width for signup card */
.signup-card { width: 520px; }

/* Basic buttons */
.btn-primary {
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #1D4ED8, #7C3AED);
  min-width: 160px;
}
.btn-secondary {
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  background: transparent;
  color: rgba(15, 23, 42, 0.75);
}
html.dark .btn-secondary { color: rgba(229, 231, 235, 0.75); }
.btn-small {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  border: none;
  color: #fff;
  background: linear-gradient(90deg, #1D4ED8, #0EA5E9);
}
.btn-small[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Signup wizard helpers */
.signup-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  color: #1D4ED8;
  background: rgba(29, 78, 216, 0.10);
  border: 1px solid rgba(29, 78, 216, 0.20);
}
html.dark .signup-pill {
  color: #93C5FD;
  background: rgba(147, 197, 253, 0.10);
  border-color: rgba(147, 197, 253, 0.18);
}
.signup-title {
  margin: 14px 0 4px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0B1A4A;
  text-align: center;
}
html.dark .signup-title { color: #E5E7EB; }
.signup-subtitle {
  margin: 0 0 22px;
  text-align: center;
  color: rgba(15, 23, 42, 0.70);
  font-size: 14px;
}
html.dark .signup-subtitle { color: rgba(229, 231, 235, 0.70); }

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: center;
  margin: 8px auto 18px;
  max-width: 420px;
}
.step {
  text-align: center;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.step .dot {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.step .label {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.75);
  font-weight: 600;
  min-height: 16px;
  line-height: 16px;
}
html.dark .step .label { color: rgba(229, 231, 235, 0.78); }
.step.active .dot { background: rgba(29, 78, 216, 0.18); border-color: rgba(29, 78, 216, 0.35); }
.step.active .label { color: #60A5FA; }
.step.done .dot { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.35); }
.step.done .label { color: rgba(34, 197, 94, 0.95); }

.step-line {
  height: 2px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  margin: 8px 0 18px;
  position: relative;
}
.step-line .progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #1D4ED8, #0EA5E9);
  border-radius: 999px;
  transition: width 250ms ease;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  margin: 14px 0 12px;
  color: #0B1A4A;
}
html.dark .section-title { color: rgba(229, 231, 235, 0.95); }

.field-label {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
  color: rgba(15, 23, 42, 0.75);
}
html.dark .field-label { color: rgba(229, 231, 235, 0.75); }

.info-box {
  margin-top: 12px;
  border-radius: 12px;
  padding: 14px;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.22);
}
html.dark .info-box {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.actions .btn-small { flex: 1 1 auto; }
.actions .btn-primary { flex: 0 0 160px; }

.bottom-link {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.70);
}
html.dark .bottom-link { color: rgba(229, 231, 235, 0.70); }
.bottom-link a { color: #60A5FA; font-weight: 700; text-decoration: none; }

.banner {
  display: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: rgba(239, 68, 68, 0.95);
  font-weight: 700;
  font-size: 13px;
}

/* OTP modal */
.otp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 18px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.otp-modal {
  width: min(560px, 100%);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 25px 60px rgba(2,6,23,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: 10001;
}
.otp-modal, .otp-modal * { box-sizing: border-box; }
html.dark .otp-modal { background: rgba(17,24,39,0.92); border-color: rgba(148, 163, 184, 0.18); }
.otp-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.otp-title { font-weight:800; font-size:18px; }
.otp-sub { margin-top:6px; color: rgba(15,23,42,0.65); font-size:13px; }
html.dark .otp-sub { color: rgba(229,231,235,0.65); }
.otp-close { border:none; background:transparent; font-size:18px; line-height:18px; color: rgba(15,23,42,0.55); cursor:pointer; }
html.dark .otp-close { color: rgba(229,231,235,0.55); }
.otp-boxes { display:grid; grid-template-columns: repeat(6, 48px); justify-content:center; gap:10px; margin:14px 0 10px; }
.otp-boxes input {
  width: 48px;
  height: 46px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.04);
  font-size: 18px;
  font-weight: 800;
  outline: none;
  color: #0F172A !important;
  caret-color: #0F172A !important;
}
html.dark .otp-boxes input { 
  background: rgba(2, 6, 23, 0.25); 
  border-color: rgba(148, 163, 184, 0.22);
  color: #ffffff !important;
  caret-color: #ffffff !important;
}
.otp-hint { text-align:center; color: rgba(15,23,42,0.55); font-size:12px; margin-bottom:12px; }
html.dark .otp-hint { color: rgba(229,231,235,0.55); }

/* OTP Actions Container */
.otp-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.otp-verify-btn {
  width: 100%;
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #1D4ED8, #7C3AED);
  cursor: pointer;
  transition: opacity 0.2s;
}
.otp-verify-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.otp-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.70);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}
.otp-resend:hover {
  color: #1D4ED8;
  text-decoration: underline;
}
.otp-resend:disabled,
.otp-resend.disabled {
  color: rgba(15, 23, 42, 0.45);
  cursor: not-allowed;
  text-decoration: none;
}
html.dark .otp-resend {
  color: rgba(229, 231, 235, 0.70);
}
html.dark .otp-resend:hover {
  color: #60A5FA;
}
html.dark .otp-resend:disabled,
html.dark .otp-resend.disabled {
  color: rgba(229, 231, 235, 0.45);
}


