/* Portal login — modern layout, animations, loader */

body.login-page,
body.signup-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 16px 48px;
  background: #0f172a;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}


.login-page__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-page__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: loginOrbFloat 14s ease-in-out infinite;
}

.login-page__orb--1 {
  width: 420px;
  height: 420px;
  background: #2563eb;
  top: -120px;
  right: -80px;
  animation-delay: 0s;
}

.login-page__orb--2 {
  width: 360px;
  height: 360px;
  background: #7c3aed;
  bottom: -100px;
  left: -60px;
  animation-delay: -4s;
}

.login-page__orb--3 {
  width: 280px;
  height: 280px;
  background: #0ea5e9;
  top: 40%;
  left: 35%;
  opacity: 0.35;
  animation-delay: -7s;
}

@keyframes loginOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.05); }
  66% { transform: translate(-16px, 12px) scale(0.95); }
}

.login-page__grid {
  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: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: loginFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Auth shell — required when main.css is not loaded (signup flow) */
.login-shell .auth-brand {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: loginFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.login-shell .auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.login-shell .form-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-shell .form-field__label {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.login-shell .form-field__input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-primary);
  font-size: 14px;
  color: #0f172a;
  border-radius: 12px;
  outline: none;
}

.login-shell .form-field__input::placeholder {
  color: #94a3b8;
}

.login-shell .auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 22px;
  color: #64748b;
  transition: color 0.2s, gap 0.2s;
}

.login-shell .auth-back:hover {
  color: var(--color-primary);
  gap: 8px;
}

.login-shell .auth-back svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.login-shell .auth-footer {
  width: 100%;
  font-size: 13.5px;
  text-align: center;
  margin: 0;
  animation: loginFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

@keyframes loginFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.login-brand__logo-wrap {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  animation: loginLogoPulse 4s ease-in-out infinite;
}

@keyframes loginLogoPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); }
  50% { transform: translateY(-6px); box-shadow: 0 22px 48px rgba(37, 99, 235, 0.2); }
}

.login-brand__logo-wrap img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.login-shell .auth-brand__title {
  color: #f8fafc;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.login-shell .auth-brand__subtitle {
  color: #94a3b8;
  margin-top: 8px;
}

.login-shell .auth-card {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  padding: 28px 28px 32px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: loginFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.login-shell .auth-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.login-card__heading {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-black);
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-card__heading i {
  color: var(--color-primary);
  font-size: 1rem;
}

.login-field__control {
  position: relative;
}

.login-field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.2s;
  z-index: 1;
}

.login-field__control .form-field__input {
  padding-left: 42px;
  padding-right: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-field__control .form-field__input:focus {
  background: #fff;
  border-color: var(--color-primary);
}

.login-field__control:focus-within .login-field__icon {
  color: var(--color-primary);
}

.login-field__control #password {
  padding-right: 44px;
}

.login-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
}

.login-toggle-pw:hover {
  color: var(--color-primary);
  background: #f1f5f9;
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: loginAlertIn 0.4s ease;
}

@keyframes loginAlertIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-alert--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.login-alert--error i {
  margin-top: 2px;
  flex-shrink: 0;
}

.login-shell .auth-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: var(--font-primary);
  background: linear-gradient(135deg, #08162a 0%, #1e3463 55%, #0b75c8 100%);
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.25s, opacity 0.2s;
  box-shadow: 0 8px 24px rgba(8, 22, 42, 0.35);
}

.login-shell .auth-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.login-shell .auth-btn:hover:not(:disabled)::before {
  transform: translateX(100%);
}

.login-shell .auth-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(11, 117, 200, 0.35);
}

.login-shell .auth-btn:disabled {
  opacity: 0.85;
  cursor: wait;
}

.login-shell .auth-btn .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

.login-shell .auth-btn.is-loading .btn-label {
  opacity: 0.7;
}

.login-shell .auth-btn.is-loading .btn-spinner {
  display: block;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

.login-shell .auth-footer {
  color: #94a3b8;
}

.login-shell .auth-footer a {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: none;
}

.login-shell .auth-footer a:hover {
  opacity: 0.85;
}

/* Full-page loader overlay */
.login-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.login-loader.is-active {
  opacity: 1;
  visibility: visible;
}

.login-loader__ring {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: loginSpin 0.75s linear infinite;
}

.login-loader__text {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  animation: loginPulseText 1.2s ease-in-out infinite;
}

@keyframes loginPulseText {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@media (max-width: 480px) {
  .login-shell .auth-card {
    padding: 22px 18px 26px;
  }

  .login-shell .auth-brand__title {
    font-size: 1.4rem;
  }
}
