:root {
  --sky: #87ceeb;
  --sky-deep: #4fa8d3;
  --brand-navy: #0d2a5a;
  --brand-red: #d9102f;
  --ink: #182033;
  --muted: #5b6882;
  --border: #e2ecf5;
  --shadow: 0 18px 50px rgba(8, 24, 56, 0.18);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, #b9e3f4 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, #cfeaf7 0%, transparent 55%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  background-attachment: fixed;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* ==========================
   Login / Auth screen
   ========================== */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-shell {
  flex-direction: column;
  gap: 18px;
}

.auth-card {
  width: min(440px, 100%);
  background: #fff;
  padding: 26px 24px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 10px;
}

.logo {
  width: 200px;
  max-width: 70%;
  height: auto;
  display: block;
}

.logo-sm {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form h2 {
  margin: 6px 0 0;
  color: var(--brand-navy);
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 0.2px;
}

.form .muted {
  text-align: center;
  margin: 0;
  font-size: 0.92rem;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.78rem;
  color: #55637f;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

input,
select,
button {
  font: inherit;
  border-radius: 10px;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d6deec;
  background: #fff;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #9aa6bd;
  font-weight: 400;
}

input:focus,
select:focus {
  outline: 2px solid #9ac9ee;
  border-color: var(--sky-deep);
}

button {
  cursor: pointer;
  border: none;
}

button[type="submit"],
.primary-btn {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-navy), #1a47a3);
  transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.2s;
  box-shadow: 0 6px 20px rgba(13, 42, 90, 0.25);
}

button[type="submit"]:hover,
.primary-btn:hover {
  opacity: 0.95;
}

button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 0.9rem;
  text-align: center;
  color: var(--brand-red);
}

.status.success {
  color: #1b7f3b;
}

.disclaimer {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ==========================
   Dashboard
   ========================== */

.dashboard {
  min-height: 100vh;
  padding: 22px clamp(16px, 4vw, 40px) 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-header {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--brand-navy);
}

.dash-brand p {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

.logout-btn {
  background: #f3f4f8;
  color: var(--brand-navy);
  padding: 10px 14px;
  font-weight: 600;
  border-radius: 10px;
}

.logout-btn:hover {
  background: #e6eaf5;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 18px;
}

.dash-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.dash-card h3 {
  margin: 0 0 12px;
  color: var(--brand-navy);
  font-size: 1rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.profile-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.profile-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  align-self: end;
}

.profile-card dd {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.eligibility-card .amount {
  margin: 4px 0 2px;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  color: var(--brand-red);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.loan-controls {
  margin: 14px 0 10px;
}

.loan-stats {
  list-style: none;
  padding: 0;
  margin: 12px 0 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.loan-stats li {
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loan-stats span {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.loan-stats strong {
  color: var(--brand-navy);
  font-size: 1rem;
}

.dash-footer {
  text-align: center;
  color: rgba(13, 42, 90, 0.7);
  font-size: 0.85rem;
  margin-top: auto;
}

/* ==========================
   Responsive
   ========================== */

@media (max-width: 820px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .logout-btn {
    align-self: stretch;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 22px 18px;
  }
  .logo {
    width: 180px;
  }
  .profile-card dl,
  .loan-stats {
    grid-template-columns: 1fr;
  }
  .dash-brand h1 {
    font-size: 1rem;
  }
}
