/* CreditGene sign-in page (frontend/login.html). The brand panel is the same
   "midnight banking" surface as the app's sidebar and dashboard banner
   (theme.css --surface-midnight); kept self-contained here because the
   sign-in page does not load theme.css. */

.login-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  background: #ffffff;
  color: #0b1226;
  font-family: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
}

/* ---------- Brand panel ---------- */

.login-brand {
  flex: 1.5 1 560px;
  min-width: 0;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(620px 420px at 88% 12%, rgba(45, 91, 255, 0.5), transparent 70%),
    radial-gradient(520px 400px at 6% 96%, rgba(34, 211, 238, 0.28), transparent 70%),
    linear-gradient(160deg, #0a1638 0%, #060b1d 55%, #040816 100%);
}
.login-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
}
.login-brand-inner {
  position: relative;
  box-sizing: border-box;
  min-height: 100vh;
  padding: 52px clamp(28px, 4.5vw, 64px) 52px clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}

.login-logo-row { display: flex; align-items: center; gap: 14px; }
.login-logo { width: 46px; height: 50px; flex-shrink: 0; }
.login-wordmark { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }
.login-wordmark span {
  background: linear-gradient(90deg, #22d3ee, #6b8cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.login-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 44px; }
.login-hero-text { flex: 1 1 320px; min-width: 0; }
.login-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.35);
  color: #9be9f7; font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
}
.login-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; }
.login-hero h2 { margin: 20px 0 16px; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.1; font-weight: 800; letter-spacing: -1.4px; }
.login-hero p { margin: 0; max-width: 460px; font-size: 17px; line-height: 1.6; color: #b8c4e0; }

.login-sample {
  flex: 0 0 300px; box-sizing: border-box; padding: 24px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}
.login-sample-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #9fb0d6;
}
.login-sample-status { padding: 3px 9px; border-radius: 999px; background: rgba(52, 211, 153, 0.15); color: #6ee7b7; text-transform: none; letter-spacing: 0; }
.login-sample-score { display: flex; align-items: center; gap: 18px; margin: 16px 0 18px; }
.login-sample-score text { font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif; }
.login-sample-score strong { display: block; font-size: 22px; font-weight: 800; }
.login-sample-score span { font-size: 13px; color: #9fb0d6; }
.login-factor {
  display: grid; grid-template-columns: 1fr auto; row-gap: 6px; margin-top: 12px; font-size: 13px; color: #d6def2;
}
.login-factor b { font-weight: 700; }
.login-factor b.up { color: #6ee7b7; }
.login-factor b.down { color: #fdba74; }
.login-factor i {
  grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #22d3ee var(--w), rgba(255, 255, 255, 0.1) var(--w));
}
.login-factor i.down { background: linear-gradient(90deg, #fb923c var(--w), rgba(255, 255, 255, 0.1) var(--w)); }

.login-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.login-features li {
  display: flex; flex-direction: column; padding: 18px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
}
.login-feature-icon {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; background: rgba(45, 91, 255, 0.25);
}
.login-features strong { font-size: 16px; font-weight: 700; }
.login-features span:last-child { margin-top: 4px; font-size: 13px; color: #9fb0d6; }

/* ---------- Sign-in panel ---------- */

.login-panel {
  flex: 1 1 440px; min-width: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; padding: 56px 48px;
}
.login-form { width: 100%; max-width: 440px; display: flex; flex-direction: column; }
.login-form h1 { margin: 0; font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.login-intro { margin: 10px 0 36px; font-size: 17px; line-height: 1.5; color: #4b5570; }

.login-field-label { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.login-field {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 6px 0 16px; box-sizing: border-box;
  border: 1.5px solid #d6dbe7; border-radius: 12px; margin-bottom: 22px; background: #f8f9fc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.login-field:focus-within { border-color: #2d5bff; background: #ffffff; box-shadow: 0 0 0 4px rgba(45, 91, 255, 0.15); }
.login-field svg { flex-shrink: 0; }
.login-field input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 16px; color: #0b1226; padding: 0; }
.login-field input::placeholder { color: #8a93a8; }
.login-eye {
  width: 44px; height: 44px; flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; background: transparent; cursor: pointer;
}
.login-eye:hover { background: #eef1f7; }
.login-eye:focus-visible { outline: 2px solid #2d5bff; outline-offset: 1px; }

.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.login-remember { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #2a3350; cursor: pointer; min-height: 44px; }
.login-remember input { width: 20px; height: 20px; margin: 0; accent-color: #2d5bff; cursor: pointer; }
.login-forgot { font-size: 15px; font-weight: 600; color: #2d5bff; text-decoration: none; padding: 10px 0; }
.login-forgot:hover { color: #1e40c8; text-decoration: underline; }

.login-message { display: none; margin: 0 0 20px; padding: 12px 16px; border-radius: 10px; font-size: 15px; }
.login-message.error { display: block; background: #fdf0f0; border: 1px solid #e0b4b4; color: #7a1d1d; }
.login-message.success { display: block; background: #eaf7ea; border: 1px solid #bcd9bc; color: #145c14; }

.login-submit {
  height: 56px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #2d5bff, #1e40c8); color: #ffffff;
  box-shadow: 0 10px 24px rgba(45, 91, 255, 0.35);
  font: inherit; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.login-submit:hover { filter: brightness(1.08); }
.login-submit:focus-visible { outline: 3px solid rgba(45, 91, 255, 0.45); outline-offset: 2px; }
.login-submit:disabled { opacity: 0.7; cursor: wait; }

.login-footer {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid #e6e9f0;
  font-size: 14px; color: #4b5570;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 1180px) {
  .login-sample { display: none; }
}
@media (max-width: 880px) {
  .login-brand { min-height: 0; flex-basis: 100%; }
  .login-brand-inner { min-height: 0; padding: 28px 24px 30px; gap: 22px; }
  .login-hero h2 { font-size: 26px; margin: 14px 0 0; }
  .login-hero p, .login-features { display: none; }
  .login-panel { padding: 30px 24px 24px; align-items: flex-start; }
  .login-form h1 { font-size: 32px; }
  .login-intro { margin-bottom: 26px; }
}
