/**
 * Kovrra Learn staff auth shell — login.php and branded 404.
 * Desktop: split brand + form. Mobile: stacked brand + sheet form.
 */
*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  height: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0a1628;
  color: #0f172a;
  overflow-x: hidden;
}

.auth-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.auth-brand {
  position: relative;
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2rem;
  overflow: hidden;
  min-height: 100%;
  background:
    linear-gradient(
      135deg,
      rgba(10, 22, 40, 0.88) 0%,
      rgba(30, 60, 114, 0.82) 48%,
      rgba(42, 82, 152, 0.78) 100%
    ),
    image-set(
      url("/assets/learn-training-background.webp") type("image/webp"),
      url("/assets/learn-training-background.jpg") type("image/jpeg")
    ) center center / cover no-repeat;
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-brand::before {
  background: radial-gradient(
    ellipse 90% 70% at 20% 20%,
    rgba(56, 189, 248, 0.12),
    transparent 60%
  );
}

.auth-brand::after {
  background: linear-gradient(
    0deg,
    rgba(10, 22, 40, 0.55) 0%,
    transparent 45%
  );
}

.auth-brand-top,
.auth-brand-mid,
.auth-brand-bot {
  position: relative;
  z-index: 1;
}

.auth-brand .floating-logos {
  display: none;
}

.auth-brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.auth-brand-top .auth-brand-logo {
  height: 40px;
  width: auto;
  max-width: min(200px, 48vw);
  object-fit: contain;
  object-position: left center;
  display: block;
  flex-shrink: 0;
}

.auth-brand-top .word {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}

.auth-brand-top .word small {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 1px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.auth-brand-mid {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 480px;
  max-width: 100%;
}

.auth-brand-mid h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -1px;
}

.auth-brand-mid h2 .accent {
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.auth-brand-mid p,
.auth-brand-mid .greeting {
  font-size: 1.02rem;
  opacity: 0.85;
  line-height: 1.55;
  margin: 0 0 32px;
}

.auth-brand-mid .greeting {
  opacity: 0.92;
  margin-bottom: 10px;
  font-weight: 600;
}

.auth-brand-mid .quote {
  font-size: 1.02rem;
  opacity: 0.85;
  line-height: 1.6;
  margin: 0 0 28px;
  font-style: italic;
  border-left: 3px solid rgba(125, 211, 252, 0.45);
  padding-left: 16px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: transform 0.2s, background 0.2s;
}

.feature-item:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.11);
}

.feature-item .icn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.25), rgba(56, 189, 248, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-item .icn svg {
  width: 18px;
  height: 18px;
  color: #bae6fd;
}

.feature-item .ttl {
  font-weight: 600;
  font-size: 0.94rem;
  margin: 0 0 2px;
}

.feature-item .sub {
  font-size: 0.82rem;
  opacity: 0.78;
  margin: 0;
}

.auth-brand-bot {
  flex-shrink: 0;
  font-size: 0.82rem;
  opacity: 0.7;
}

.auth-brand-bot a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  margin: 0 6px;
}

.auth-brand-bot a:hover {
  color: #fff;
  text-decoration: underline;
}

.auth-form-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  position: relative;
  min-height: 100%;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-mobile-mark {
  display: none;
}

.auth-eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.auth-title {
  font-size: clamp(1.55rem, 2.4vw, 1.85rem);
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

.auth-subtitle {
  color: #64748b;
  font-size: 0.98rem;
  margin: 0 0 28px;
  line-height: 1.45;
}

.auth-card.verify-card {
  text-align: center;
}

.auth-card.verify-card .auth-title,
.auth-card.verify-card .auth-subtitle {
  text-align: center;
}

.auth-card.verify-card .auth-subtitle {
  margin-bottom: 22px;
}

.verify-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 6px 18px rgba(30, 60, 114, 0.28);
}

.verify-badge svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.code-input {
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 0.32em;
  padding: 0.8rem 1rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  width: 100%;
  background: #fafbff;
  transition: all 0.15s;
  min-height: 48px;
}

.code-input:focus {
  border-color: #1e3c72;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30, 60, 114, 0.1);
  outline: none;
}

.code-input::placeholder {
  letter-spacing: 0.28em;
  color: #cbd5e1;
  font-weight: 500;
}

.auth-brand-mid.verify-quiet h2 {
  margin-bottom: 12px;
}

.auth-brand-mid.verify-quiet .greeting {
  margin-bottom: 10px;
}

.auth-brand-mid.verify-quiet > p {
  margin-bottom: 0;
}

.auth-alert {
  border-radius: 11px;
  font-size: 0.9rem;
  padding: 13px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.auth-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 48px;
  padding: 0.78rem 1rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.google-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #1e293b;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

.auth-foot-note {
  margin: 1.1rem 0 0;
  color: #94a3b8;
  font-size: 0.82rem;
  text-align: center;
  line-height: 1.4;
}

.divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.divider span {
  padding: 0 14px;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.form-label {
  font-weight: 600;
  color: #334155;
  margin-bottom: 7px;
  font-size: 0.86rem;
}

.form-control {
  padding: 0.78rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  font-size: 0.95rem;
  transition: all 0.15s;
  background: #fafbff;
  width: 100%;
  min-height: 48px;
}

.form-control:focus {
  border-color: #1e3c72;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30, 60, 114, 0.1);
  outline: none;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.input-with-icon .input-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.input-with-icon .form-control {
  padding-left: 42px;
}

.btn-login {
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  border: none;
  border-radius: 11px;
  color: #fff;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(30, 60, 114, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(30, 60, 114, 0.35);
  background: linear-gradient(135deg, #1a2d4f 0%, #244c87 100%);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-login svg {
  width: 16px;
  height: 16px;
}

.auth-field { margin-bottom: 1rem; }
.auth-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 12px;
}
.auth-hint { margin-top: 0.5rem; font-size: 0.875rem; }
.auth-sep { margin: 0 8px; opacity: 0.4; }
.pw-wrap { position: relative; }
.pw-input { padding-right: 2.85rem; }
.icon-hidden { display: none !important; }
.auth-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.auth-social a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #64748b;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}
.auth-social a:hover { color: #0f172a; text-decoration: underline; }
.auth-more { margin: 1rem 0 0; color: #475569; font-size: 0.95rem; line-height: 1.55; }
.auth-faq {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}
.auth-faq h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.85rem;
}
.auth-faq h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e3c72;
  margin: 0.85rem 0 0.35rem;
}
.auth-faq p {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
}

.forgot-link {
  color: #1e3c72;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
  transition: color 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.forgot-link:hover {
  color: #2a5298;
  text-decoration: underline;
}

.register-link {
  text-align: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
  color: #64748b;
  font-size: 0.88rem;
}

.register-link strong {
  color: #0f172a;
  font-weight: 600;
}

.platform-switch {
  margin-top: 14px;
}

.platform-switch a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
  color: #1e3c72;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.platform-switch a:hover {
  border-color: #94a3b8;
  background: #fff;
  color: #2a5298;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.platform-switch small {
  display: block;
  color: #64748b;
  font-weight: 500;
  font-size: 0.75rem;
  margin-top: 1px;
}

.platform-switch svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.password-toggle {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  border-radius: 6px;
}

.password-toggle:hover {
  color: #475569;
  background: #f1f5f9;
}

.auth-footer {
  padding: 1rem 2rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background: transparent;
  color: #64748b;
  position: relative;
  z-index: 1;
}

.auth-footer p {
  margin: 0;
  font-size: 0.78rem;
}

.auth-footer a {
  color: #64748b;
  text-decoration: none;
}

.auth-footer a:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* —— Mobile: stacked brand then form, no overlay —— */
@media (max-width: 991px) {
  html {
    height: auto;
  }

  .auth-shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .auth-brand {
    display: flex;
    min-height: auto;
    height: auto;
    padding: calc(24px + env(safe-area-inset-top, 0px)) 22px 32px;
    gap: 1.35rem;
  }

  .auth-brand-top {
    gap: 12px;
  }

  .auth-brand-top .auth-brand-logo {
    height: 34px;
    max-width: min(180px, 44vw);
  }

  .auth-brand-top .word {
    font-size: 0.98rem;
  }

  .auth-brand-mid {
    flex: 0 0 auto;
    justify-content: flex-start;
    width: 100%;
  }

  .auth-brand-mid h2 {
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 6.4vw, 2.05rem);
  }

  .auth-brand-mid p,
  .auth-brand-mid .quote {
    margin-bottom: 18px;
    font-size: 0.95rem;
  }

  .feature-list {
    gap: 10px;
  }

  .feature-item {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .feature-item .icn {
    width: 32px;
    height: 32px;
  }

  .auth-brand-bot {
    font-size: 0.78rem;
  }

  .auth-form-panel {
    background: #fff;
    padding: 32px 22px calc(32px + env(safe-area-inset-bottom, 0px));
    padding-left: max(22px, env(safe-area-inset-left, 0px));
    padding-right: max(22px, env(safe-area-inset-right, 0px));
    border-radius: 0;
    margin-top: 0;
    position: static;
    z-index: auto;
    box-shadow: none;
    min-height: auto;
    justify-content: flex-start;
  }

  .auth-card {
    max-width: none;
    width: 100%;
    background: #fff;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .auth-mobile-mark {
    display: none !important;
  }

  .auth-subtitle {
    margin-bottom: 1.35rem;
  }

  .form-control {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .auth-brand {
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    padding-right: max(18px, env(safe-area-inset-right, 0px));
  }

  .feature-item .sub {
    font-size: 0.78rem;
  }

  .auth-form-panel {
    padding-top: 28px;
  }

  .auth-title {
    font-size: 1.45rem;
  }

  .google-btn,
  .btn-login,
  .form-control {
    min-height: 48px;
  }

  .platform-switch a {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-item,
  .google-btn,
  .btn-login,
  .platform-switch a {
    transition: none;
  }

  .feature-item:hover,
  .google-btn:hover,
  .btn-login:hover,
  .platform-switch a:hover {
    transform: none;
  }
}
