/* ═════════════════════════════════════
   LOGIN PAGE — SegurosFly
   ═════════════════════════════════════ */

.login-body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  min-height: 100vh;
}

/* ─── HERO (left) ─── */
.login-hero {
  position: relative;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,208,0,.32) 0%, transparent 45%),
    radial-gradient(circle at 15% 90%, rgba(243,152,32,.20) 0%, transparent 50%),
    linear-gradient(135deg, #002F4F 0%, #07304F 45%, #0A3A66 100%);
  color: #fff;
  padding: 36px 48px 32px;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 100vh;
}

/* decorative orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  opacity: .55;
}
.orb-1 { top: -120px; right: -80px; width: 340px; height: 340px; background: radial-gradient(circle, #FFD000 0%, transparent 70%); }
.orb-2 { bottom: -100px; left: -80px; width: 280px; height: 280px; background: radial-gradient(circle, #F39820 0%, transparent 70%); opacity: .4; }
.orb-3 { top: 50%; left: 50%; width: 480px; height: 480px; background: radial-gradient(circle, rgba(0,47,79,.45) 0%, transparent 60%); transform: translate(-50%, -50%); }

.login-hero-top {
  position: relative; z-index: 2;
}
.login-hero-logo {
  height: 60px; width: auto;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,.25));
}

.login-hero-content {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 520px;
  padding: 60px 0 40px;
}

.login-eyebrow {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--brand-yellow);
  margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 10px;
}
.login-eyebrow::before {
  content: ''; width: 24px; height: 1px;
  background: var(--brand-yellow);
}

.login-hero-title {
  font-size: 48px; font-weight: 700; line-height: 1.05;
  letter-spacing: -1.2px;
  margin-bottom: 22px;
  color: #fff;
}
.login-hero-title .grad-text {
  background: linear-gradient(135deg, #FFD000 0%, #F39820 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.login-hero-sub {
  font-size: 15px; line-height: 1.6;
  color: rgba(255,255,255,.78);
  max-width: 440px;
  margin-bottom: 48px;
}

/* Stats row */
.login-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 480px;
}
.stat {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 18px 16px;
  backdrop-filter: blur(8px);
}
.stat-val {
  font-size: 26px; font-weight: 700;
  color: var(--brand-yellow);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-val span { font-size: 16px; opacity: .8; }
.stat-lbl {
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.65);
  margin-top: 8px; line-height: 1.35;
  text-transform: uppercase; letter-spacing: .6px;
}

.login-hero-foot {
  position: relative; z-index: 2;
  font-size: 12px; color: rgba(255,255,255,.55);
  display: flex; align-items: center; gap: 10px;
}
.login-hero-foot .dot { opacity: .5; }
.login-hero-foot a { color: rgba(255,255,255,.70); }
.login-hero-foot a:hover { color: var(--brand-yellow); }

/* ─── FORM SIDE (right) ─── */
.login-form-side {
  position: relative;
  background: var(--surface);
  padding: 40px 56px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
}
[data-theme="dark"] .login-form-side {
  background: var(--bg);
}

.login-toggle {
  position: absolute;
  top: 28px; right: 32px;
}

.login-form-wrap {
  width: 100%; max-width: 420px;
  margin: 0 auto;
}

.login-form-head {
  text-align: left;
  margin-bottom: 32px;
}
.login-form-mark {
  height: 36px; margin-bottom: 28px;
}
[data-theme="dark"] .login-form-mark {
  /* Use white logo variant in dark mode via opacity tweak — image is dark navy */
  filter: brightness(1.1);
}
.login-form-head h2 {
  font-size: 30px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}
.login-form-head p {
  font-size: 14px; color: var(--text-2);
  line-height: 1.5;
}

/* ─── FORM FIELDS ─── */
.login-form { display: flex; flex-direction: column; gap: 18px; }

.field {
  display: flex; flex-direction: column;
  gap: 8px;
}
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700;
  color: var(--text);
  text-transform: uppercase; letter-spacing: 1px;
}
.field-link {
  font-size: 11px; font-weight: 600;
  color: var(--brand-orange);
  text-transform: none; letter-spacing: 0;
}
.field-link:hover { text-decoration: underline; }

.field-wrap {
  position: relative;
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field-wrap:focus-within {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 4px rgba(243,152,32,.15);
  background: var(--surface);
}
.field-icon {
  width: 18px; height: 18px;
  margin-left: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.field-wrap:focus-within .field-icon { color: var(--brand-orange); }

.field-wrap input {
  flex: 1;
  border: none; background: transparent;
  padding: 14px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.field-wrap input::placeholder { color: var(--text-muted); }

.field-toggle {
  background: transparent; border: none;
  padding: 0 14px;
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center;
  height: 100%;
}
.field-toggle svg { width: 18px; height: 18px; }
.field-toggle:hover { color: var(--brand-orange); }
.field-toggle.on { color: var(--brand-orange); }

/* ─── CHECKBOX ─── */
.check-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  font-size: 13px; color: var(--text);
}
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-2);
  border-radius: 5px;
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
  position: relative;
}
.check-row input:checked + .check-box {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
}
.check-row input:checked + .check-box::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ─── SUBMIT BUTTON ─── */
.login-btn {
  margin-top: 6px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #F39820 0%, #FFB820 50%, #FFD000 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: #002F4F;
  border: none;
  border-radius: 12px;
  font-size: 15px; font-weight: 700;
  font-family: inherit;
  letter-spacing: .3px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(243,152,32,.30), 0 2px 4px rgba(243,152,32,.20);
  transition: transform .15s, box-shadow .2s, background-position .35s;
}
.login-btn svg { width: 18px; height: 18px; transition: transform .25s; }
.login-btn:hover {
  background-position: 100% 50%;
  box-shadow: 0 12px 32px rgba(243,152,32,.40), 0 2px 4px rgba(243,152,32,.20);
  transform: translateY(-1px);
}
.login-btn:hover svg { transform: translateX(4px); }
.login-btn:active { transform: translateY(0); }
.login-btn.loading {
  pointer-events: none;
  background: linear-gradient(135deg, #94A3B8 0%, #94A3B8 100%);
  box-shadow: none;
}
.login-btn.loading svg {
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── DIVIDER ─── */
.login-divider {
  display: flex; align-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.4px;
  margin: 8px 0 4px;
  gap: 14px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}

/* ─── SSO ─── */
.login-sso-row {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.sso-btn {
  height: 48px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.sso-btn svg { width: 22px; height: 22px; }
.sso-btn:hover {
  border-color: var(--brand-orange);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,47,79,.08);
}
[data-theme="dark"] .sso-btn { background: var(--surface-2); }
[data-theme="dark"] .sso-btn svg path[fill="#002F4F"],
[data-theme="dark"] .sso-btn svg path[stroke="#002F4F"] { stroke: #fff; fill: #fff; }

.login-help {
  margin-top: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
.login-help a { color: var(--brand-orange); font-weight: 600; }
.login-help a:hover { text-decoration: underline; }

/* ─── DARK theme adjustments ─── */
[data-theme="dark"] .field-wrap {
  background: var(--surface);
  border-color: var(--border-2);
}
[data-theme="dark"] .field-wrap:focus-within {
  background: var(--surface);
}
[data-theme="dark"] .check-box {
  background: var(--surface);
  border-color: var(--border-2);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero {
    min-height: auto;
    padding: 32px 32px 28px;
  }
  .login-hero-content { padding: 32px 0 24px; max-width: none; }
  .login-hero-title { font-size: 36px; }
  .login-hero-sub { font-size: 14px; margin-bottom: 28px; }
  .login-stats { grid-template-columns: repeat(3, 1fr); }
  .login-form-side { padding: 40px 32px 56px; }
}
@media (max-width: 520px) {
  .login-hero { padding: 28px 24px 24px; }
  .login-hero-title { font-size: 30px; }
  .login-hero-sub { margin-bottom: 22px; }
  .login-stats { grid-template-columns: 1fr 1fr; }
  .login-stats .stat:last-child { display: none; }
  .login-form-side { padding: 32px 24px 48px; }
  .login-form-head h2 { font-size: 26px; }
}
