:root {
  --primary: #1a56db;
  --primary-dark: #1446b8;
  --primary-light: #e8f0fe;
  --success: #0e9f6e;
  --warning: #c27803;
  --danger: #e02424;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.07), 0 10px 30px rgba(0,0,0,.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ── */
header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1rem; padding-bottom: 1rem;
}
.logo { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); text-decoration: none; }
.logo span { color: var(--primary); }
nav { display: flex; align-items: center; gap: 1rem; }
nav a:not(.btn) { color: var(--gray-600); text-decoration: none; font-weight: 500; }
nav a:not(.btn):hover { color: var(--primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem 1.25rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  border: 2px solid transparent; text-decoration: none;
  transition: all .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1a56db 0%, #0e3a9a 100%);
  color: #fff; padding: 5rem 0;
  text-align: center;
}
.hero h1 { font-size: 2.75rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero .hero-sub { font-size: 1.2rem; opacity: .88; max-width: 500px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn-outline:hover { background: rgba(255,255,255,.15); }

/* ── Features ── */
.features { padding: 5rem 0; }
.features h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 3rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.feature-card {
  background: #fff; border-radius: var(--radius); padding: 2rem 1.5rem;
  box-shadow: var(--shadow); text-align: center;
}
.feature-icon {
  width: 3rem; height: 3rem; background: var(--primary-light); color: var(--primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800; margin: 0 auto 1rem;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.feature-card p { color: var(--gray-600); font-size: .95rem; }

/* ── CTA Section ── */
.cta-section { background: var(--gray-100); padding: 4rem 0; text-align: center; }
.cta-section h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: .75rem; }
.cta-section p { color: var(--gray-600); margin-bottom: 2rem; }

/* ── Footer ── */
footer { background: var(--gray-900); color: var(--gray-400); padding: 2rem 0; text-align: center; font-size: .875rem; }

/* ── Form Page ── */
.form-page { padding: 3rem 0 5rem; }
.form-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 2.5rem; max-width: 800px; margin: 0 auto;
}
.form-header { margin-bottom: 2rem; }
.form-header h1 { font-size: 1.75rem; font-weight: 700; }
.form-header p { color: var(--gray-600); margin-top: .4rem; }
.form-section-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--gray-400);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: .5rem; margin: 1.75rem 0 1rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .375rem; }
.form-group.full-width { grid-column: 1 / -1; }
label { font-size: .875rem; font-weight: 600; color: var(--gray-700); }
.required { color: var(--danger); }
input, select, textarea {
  padding: .625rem .875rem; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: .95rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  background: #fff; color: var(--gray-900); width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
textarea { resize: vertical; }
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); font-weight: 600;
}
.input-prefix-wrap input { padding-left: 1.75rem; }
.form-actions { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Alerts ── */
.alert { padding: .875rem 1.125rem; border-radius: 8px; font-size: .9rem; margin-top: 1rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── Success State ── */
.success-icon {
  width: 4rem; height: 4rem; background: #d1fae5; color: var(--success);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; margin: 0 auto 1.5rem;
}
.form-card h2 { text-align: center; font-size: 1.5rem; margin-bottom: .5rem; }
.form-card > p { text-align: center; color: var(--gray-600); }
.application-id-box {
  background: var(--gray-50); border: 1.5px solid var(--gray-200); border-radius: 8px;
  padding: 1.25rem 1.5rem; margin: 1.5rem 0; text-align: center;
}
.application-id-box .label { font-size: .8rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .07em; }
.application-id-box .app-id { font-size: 1rem; font-family: monospace; color: var(--primary); font-weight: 700; margin: .5rem 0; word-break: break-all; }
.application-id-box .hint { font-size: .8rem; color: var(--gray-400); }

/* ── Status Page ── */
.status-badge-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.status-badge {
  display: inline-block; padding: .3rem .85rem; border-radius: 99px;
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-defaulted { background: #f3f4f6; color: #374151; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.5rem; }
.info-grid .info-item {}
.info-grid .info-item .label { font-size: .75rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .07em; }
.info-grid .info-item .value { font-size: .975rem; font-weight: 500; margin-top: .2rem; }

.repayment-bar-wrap { margin-top: 1.25rem; }
.repayment-bar-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--gray-600); margin-bottom: .4rem; }
.repayment-bar { height: 10px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.repayment-bar-fill { height: 100%; background: var(--success); border-radius: 99px; transition: width .5s ease; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.9rem; }
  .form-row { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .form-card { padding: 1.5rem; }
}
