/* ===========================
   Fi.om — Global Stylesheet
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== VARIABLES ===== */
:root {
  --primary:       #00A862;
  --primary-dark:  #007A47;
  --primary-light: #E6F5EE;
  --primary-mid:   #00C472;
  --dark:          #1A2E25;
  --text:          #2D3748;
  --text-muted:    #718096;
  --border:        #E2E8F0;
  --bg:            #F7FBF9;
  --white:         #FFFFFF;
  --error:         #E53E3E;
  --success:       #00A862;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.12);
  --radius:        8px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --transition:    0.2s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 2.75rem; font-weight: 800; line-height: 1.15; color: var(--dark); }
h2 { font-size: 2rem;    font-weight: 700; line-height: 1.25; color: var(--dark); }
h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.35; color: var(--dark); }
h4 { font-size: 1.125rem; font-weight: 600; color: var(--dark); }
p  { color: var(--text-muted); }

/* ===== LAYOUT ===== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.text-center { text-align: center; }
.section-header { margin-bottom: 48px; }
.section-header p { font-size: 1.125rem; margin-top: 12px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,168,98,0.35);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
}
.btn-lg {
  padding: 18px 40px;
  font-size: 1.125rem;
  border-radius: var(--radius-lg);
}
.btn-sm {
  padding: 10px 20px;
  font-size: 0.875rem;
}
.btn-full { width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 160px;
  display: flex;
  align-items: center;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
}
.nav-logo span { color: var(--dark); font-weight: 400; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  margin: 5px 0;
  border-radius: 2px;
  transition: all var(--transition);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #f0faf5 0%, #e6f5ee 50%, #f7fbf9 100%);
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,168,98,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 60px;
}
.hero-text { flex: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-badge::before { content: '✦'; font-size: 0.75rem; }
.hero h1 { margin-bottom: 16px; }
.hero h1 em { color: var(--primary); font-style: normal; }
.hero > .container > .hero-inner > .hero-text > p {
  font-size: 1.125rem;
  margin-bottom: 32px;
  color: var(--text-muted);
  max-width: 480px;
}
.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-note { font-size: 0.8125rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.hero-note::before { content: '🔒'; font-size: 0.875rem; }

.hero-card {
  flex-shrink: 0;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 340px;
}
.hero-card h3 { margin-bottom: 20px; font-size: 1.125rem; }
.loan-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.loan-type-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}
.loan-type-pill:hover, .loan-type-pill.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.loan-type-pill .icon { font-size: 1.5rem; }

/* ===== HOW IT WORKS ===== */
.how-it-works { background: var(--white); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}
.steps-grid::before {
  content: '';
  position: absolute;
  top: 32px;
  left: calc(16.66% + 16px);
  right: calc(16.66% + 16px);
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-style: dashed;
}
.step {
  text-align: center;
  position: relative;
}
.step-number {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 3px solid var(--primary);
  position: relative;
  z-index: 1;
  background: var(--white);
}
.step-icon { font-size: 1.75rem; margin-bottom: 12px; }
.step h3 { margin-bottom: 8px; }
.step p { font-size: 0.9375rem; }

/* ===== LOAN TYPES SECTION ===== */
.loan-types-section { background: var(--bg); }
.loan-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.loan-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}
.loan-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.loan-card .loan-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.loan-card h3 { font-size: 1.125rem; margin-bottom: 8px; }
.loan-card p { font-size: 0.9rem; margin-bottom: 16px; }
.loan-card .min-salary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 20px;
}
.loan-card-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 12px;
}
.loan-card-link:hover { gap: 8px; }

/* ===== TRUST / WHY SECTION ===== */
.why-section { background: var(--white); }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}
.trust-item .trust-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.trust-item h4 { margin-bottom: 6px; }
.trust-item p { font-size: 0.9rem; }

/* ===== STATS BANNER ===== */
.stats-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 56px 0;
  color: var(--white);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}
.stat-item .stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-item .stat-label {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ===== CTA SECTION ===== */
.cta-section {
  background: var(--bg);
  text-align: center;
}
.cta-box {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  color: var(--white);
  max-width: 720px;
  margin: 0 auto;
}
.cta-box h2 { color: var(--white); margin-bottom: 12px; }
.cta-box p { color: rgba(255,255,255,0.85); font-size: 1.0625rem; margin-bottom: 32px; }
.cta-box .btn-white {
  background: var(--white);
  color: var(--primary-dark);
  border: none;
}
.cta-box .btn-white:hover { background: #f0f0f0; transform: translateY(-2px); }

/* ===== FOOTER ===== */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 56px 0 24px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .nav-logo { color: var(--white); margin-bottom: 12px; }
.footer-brand .nav-logo span { color: rgba(255,255,255,0.5); }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; }
.footer-col h4 {
  color: var(--white);
  font-size: 0.9375rem;
  margin-bottom: 16px;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.9rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--primary-mid); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}
.footer-legal { display: flex; gap: 24px; }
.footer-legal a:hover { color: var(--primary-mid); }

/* ===== FORM PAGE ===== */
.form-page {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 80px;
}
.form-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}
.form-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-header-text h2 {
  font-size: 1.25rem;
  margin-bottom: 2px;
}
.form-header-text p {
  font-size: 0.875rem;
}

/* Progress Bar */
.progress-wrap { width: 100%; max-width: 560px; }
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Form Container */
.form-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}
.form-step { display: none; }
.form-step.active { display: block; }

.step-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}
.step-subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.9375rem;
}

/* Loan Type Selector (Step 1) */
.loan-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.loan-option {
  position: relative;
}
.loan-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.loan-option-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.loan-option input:checked + .loan-option-label {
  border-color: var(--primary);
  background: var(--primary-light);
}
.loan-option-label:hover { border-color: var(--primary); }
.loan-option-icon { font-size: 1.75rem; flex-shrink: 0; line-height: 0; }
.loan-option-text strong { display: block; font-size: 0.9375rem; color: var(--dark); }
.loan-option-text span { font-size: 0.8125rem; color: var(--text-muted); }

/* Form Fields */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-row.full { grid-template-columns: 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group { margin-bottom: 0; }
.form-group.full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
label .required { color: var(--error); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,168,98,0.12);
}
.form-control.error { border-color: var(--error); }
.form-control::placeholder { color: #A0AEC0; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}
.input-prefix-wrap .form-control { padding-left: 56px; }

.field-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
  display: none;
}
.form-control.error ~ .field-error { display: block; }

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Yes/No toggle */
.toggle-group { display: flex; gap: 12px; }
.toggle-option { flex: 1; }
.toggle-option input[type="radio"] { display: none; }
.toggle-label {
  display: block;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.toggle-option input:checked + .toggle-label {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.toggle-label:hover { border-color: var(--primary); color: var(--primary-dark); }

/* Conditional fields */
.conditional { display: none; }
.conditional.visible { display: contents; }

/* Review Summary */
.review-section { margin-bottom: 28px; }
.review-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--primary-light);
}
.review-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.review-row:last-child { border-bottom: none; }
.review-label { font-size: 0.875rem; color: var(--text-muted); flex-shrink: 0; }
.review-value { font-size: 0.9375rem; font-weight: 500; color: var(--dark); text-align: right; }

/* Checkbox */
.checkbox-group { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-group label {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 0;
  cursor: pointer;
}

/* Form Navigation */
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.form-nav .btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}
.form-nav .btn-back:hover { color: var(--primary); }

/* ===== RESULT PAGE ===== */
.result-page { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.result-page .navbar { position: relative; }
.result-main { flex: 1; display: flex; align-items: center; padding: 60px 0; }
.result-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.result-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 24px;
}
.result-icon.success { background: var(--primary-light); }
.result-icon.pending { background: #FFF8E1; }
.result-card h2 { margin-bottom: 12px; }
.result-card .result-sub { font-size: 1.0625rem; margin-bottom: 32px; max-width: 440px; margin-left: auto; margin-right: auto; }
.result-ref {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 32px;
}
.result-steps {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  text-align: left;
}
.result-steps h4 { margin-bottom: 16px; font-size: 0.9375rem; }
.result-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.result-step-item:last-child { margin-bottom: 0; }
.result-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  h1 { font-size: 2.25rem; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  .section { padding: 56px 0; }
  .nav-links, .nav-actions .btn-outline { display: none; }
  .nav-toggle { display: block; }
  .hero-inner { flex-direction: column; gap: 40px; }
  .hero-card { width: 100%; }
  .steps-grid { grid-template-columns: 1fr; }
  .steps-grid::before { display: none; }
  .loan-types-grid { grid-template-columns: 1fr 1fr; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.three { grid-template-columns: 1fr; }
  .step-card { padding: 24px; }
  .loan-selector-grid { grid-template-columns: 1fr; }
  .result-card { padding: 36px 24px; }
  .cta-box { padding: 40px 24px; }
}

@media (max-width: 480px) {
  .loan-types-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-header .container { flex-direction: column; align-items: flex-start; gap: 12px; }
  .progress-wrap { width: 100%; }
}
