:root {
  --primary: #F5B800;
  --primary-dark: #d9a200;
  --primary-light: #fff8e1;
  --dark: #1a1a2e;
  --dark2: #16213e;
  --text: #222;
  --text2: #555;
  --text3: #999;
  --border: #e5e7eb;
  --white: #fff;
  --success: #16a34a;
  --success-light: #dcfce7;
  --error: #dc2626;
  --error-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --info: #2563eb;
  --info-light: #dbeafe;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.13);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: #f4f6fb;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.app-header {
  background: var(--primary);
  padding: 14px 18px;
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.header-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 38px; height: 38px; background: var(--white);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: var(--primary);
}
.logo-text { font-size: 20px; font-weight: 800; color: var(--dark); letter-spacing: -0.5px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.notif-btn {
  position: relative; width: 38px; height: 38px; background: rgba(255,255,255,0.25);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; text-decoration: none; color: var(--dark);
}
.notif-badge {
  position: absolute; top: -2px; right: -2px; background: var(--error);
  color: #fff; font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.shield-icon { width: 34px; height: 34px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--white); border-top: 1.5px solid var(--border);
  display: flex; padding: 8px 0 10px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; text-decoration: none; color: var(--text3);
  font-size: 11px; font-weight: 500; padding: 4px 0;
  border: none; background: none; cursor: pointer; transition: color .2s;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 22px; height: 22px; }
.nav-item .nav-indicator {
  width: 20px; height: 3px; background: var(--primary);
  border-radius: 2px; display: none; margin-top: 2px;
}
.nav-item.active .nav-indicator { display: block; }

/* ===== HERO SECTION ===== */
.hero-section {
  background: var(--primary);
  padding: 28px 18px 50px;
  position: relative; overflow: hidden;
}
.hero-section::before {
  content: ''; position: absolute;
  width: 200px; height: 200px; background: rgba(255,255,255,0.07);
  border-radius: 50%; top: -60px; right: -40px;
}
.hero-section::after {
  content: ''; position: absolute;
  width: 120px; height: 120px; background: rgba(255,255,255,0.05);
  border-radius: 50%; bottom: 20px; left: -30px;
}
.hero-title { font-size: 28px; font-weight: 800; color: var(--dark); line-height: 1.2; margin-bottom: 8px; }
.hero-subtitle { font-size: 13px; color: rgba(26,26,46,0.7); font-weight: 500; }
.hero-subtitle span { margin-right: 4px; }

/* ===== CARD ===== */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 18px; margin: 0 14px;
}
.card-floating { margin-top: -24px; position: relative; z-index: 10; }

/* ===== STEP INDICATOR ===== */
.steps-row {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-bottom: 20px;
}
.step-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: #f3f4f6; display: flex; align-items: center;
  justify-content: center; font-size: 20px; position: relative;
}
.step-circle.active { background: var(--primary-light); }
.step-circle.done { background: var(--success-light); }
.step-label { font-size: 11px; color: var(--text3); font-weight: 500; }
.step-arrow { color: var(--primary); font-size: 14px; margin-bottom: 16px; }
.step-dots { display: flex; gap: 3px; align-items: center; margin-bottom: 16px; }
.step-dots span {
  width: 28px; height: 2px; background: #e5e7eb; border-radius: 2px;
  display: block;
}
.step-dots span.done { background: var(--primary); }

/* ===== FORM ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
.form-label span.req { color: var(--error); margin-left: 2px; }
.form-control {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--text);
  background: var(--white); outline: none; font-family: var(--font);
  transition: border-color .2s, box-shadow .2s; appearance: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,184,0,0.15); }
.form-control.error { border-color: var(--error); }
.form-control.success { border-color: var(--success); }
.form-error { font-size: 12px; color: var(--error); margin-top: 5px; display: none; }
.form-error.show { display: block; }
.input-group { display: flex; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,184,0,0.15); }
.input-prefix {
  padding: 14px 14px; background: #f9fafb; font-size: 15px;
  font-weight: 600; color: var(--text2); border-right: 1.5px solid var(--border);
  white-space: nowrap;
}
.input-group .form-control { border: none; border-radius: 0; box-shadow: none; }
.select-wrapper { position: relative; }
.select-wrapper svg {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--text3); width: 18px; height: 18px;
}
select.form-control { padding-right: 44px; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 5px; }

/* ===== BUTTONS ===== */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px 24px; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; border: none; cursor: pointer;
  font-family: var(--font); transition: all .2s; text-decoration: none;
  letter-spacing: 0.2px;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary); color: var(--dark);
  box-shadow: 0 4px 16px rgba(245,184,0,0.3);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #e5e7eb; color: var(--text3); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary {
  background: #f4f6fb; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-danger { background: var(--error); color: #fff; }
.btn-sm { padding: 10px 18px; font-size: 14px; border-radius: var(--radius-xs); }
.btn-icon { width: auto; padding: 10px 14px; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== PROCESSING ANIMATION ===== */
.processing-container { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; }
.processing-ring {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary-light); display: flex;
  align-items: center; justify-content: center; margin-bottom: 24px; position: relative;
}
.processing-ring .ring-spinner {
  width: 56px; height: 56px; border: 4px solid #e5e7eb;
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.processing-ring.success-ring { background: var(--success-light); }
.processing-ring.success-ring .ring-spinner {
  border-color: var(--success-light);
  border-top-color: var(--success);
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-title { font-size: 22px; font-weight: 800; color: var(--dark); margin-bottom: 6px; text-align: center; }
.processing-subtitle { font-size: 14px; color: var(--text3); text-align: center; margin-bottom: 28px; }

.step-list { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.step-list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: #f9fafb; border: 1.5px solid transparent;
  font-size: 14px; font-weight: 600; color: var(--text3);
  transition: all 0.3s;
}
.step-list-item.active {
  background: var(--primary-light); border-color: var(--primary);
  color: var(--primary-dark);
}
.step-list-item.done {
  background: var(--success-light); border-color: var(--success);
  color: var(--success);
}
.step-list-icon {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.step-list-icon.pending { background: #e5e7eb; }
.step-list-icon.active { background: var(--primary); }
.step-list-icon.done { background: var(--success); }
.step-list-icon svg { width: 14px; height: 14px; color: #fff; }
.step-list-item .step-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(245,184,0,0.3);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-left: auto;
}

/* ===== INFO ROWS ===== */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text3); font-weight: 500; }
.info-row .value { font-weight: 700; color: var(--dark); text-align: right; }
.info-row .value.highlight { color: var(--primary-dark); font-size: 15px; }

/* ===== APPROVED BOX ===== */
.approved-box {
  background: var(--primary-light); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; margin-bottom: 20px;
}
.approved-label { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--text3); text-transform: uppercase; margin-bottom: 4px; }
.approved-amount { font-size: 36px; font-weight: 900; color: var(--dark); }
.emi-summary { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ===== LOAN SLIDER ===== */
.amount-display { font-size: 36px; font-weight: 900; color: var(--dark); text-align: center; margin-bottom: 12px; }
.slider-wrap { position: relative; margin-bottom: 6px; }
input[type=range] {
  -webkit-appearance: none; width: 100%; height: 6px;
  background: linear-gradient(to right, var(--primary) var(--val,0%), #e5e7eb var(--val,0%));
  border-radius: 3px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(245,184,0,0.4); cursor: pointer;
}
.slider-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text3); }
.emi-preview {
  background: #f9fafb; border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 16px 0;
}
.emi-preview-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text3); text-transform: uppercase; margin-bottom: 10px; }
.emi-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.emi-row .emi-val { font-weight: 700; color: var(--dark); }

/* ===== PROFILE SECTION ===== */
.profile-header {
  background: var(--primary); padding: 22px 18px;
  display: flex; align-items: center; gap: 14px;
  border-radius: 0 0 var(--radius) var(--radius);
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.25); display: flex;
  align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.profile-name { font-size: 18px; font-weight: 800; color: var(--dark); }
.profile-phone { font-size: 13px; color: rgba(26,26,46,0.6); }

.profile-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 12px 14px; overflow: hidden;
}
.profile-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
}
.profile-item:last-child { border-bottom: none; }
.profile-item-icon {
  width: 38px; height: 38px; border-radius: var(--radius-xs);
  background: var(--primary-light); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-item-icon svg { width: 18px; height: 18px; color: var(--primary-dark); }
.profile-item-text { flex: 1; }
.profile-item-label { font-size: 13px; font-weight: 700; color: var(--text); }
.profile-item-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
.profile-item-arrow { color: var(--text3); }
.profile-item-arrow svg { width: 16px; height: 16px; }

/* ===== KYC BADGES ===== */
.kyc-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.kyc-badge.verified { background: var(--success-light); color: var(--success); }
.kyc-badge.pending { background: var(--warning-light); color: var(--warning); }
.kyc-badge.rejected { background: var(--error-light); color: var(--error); }
.kyc-badge svg { width: 13px; height: 13px; }

/* ===== STATUS PAGE ===== */
.status-header {
  background: var(--white); border-radius: var(--radius);
  padding: 18px; margin: 0 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
}
.status-avatar {
  width: 48px; height: 48px; background: var(--primary);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 20px;
}
.status-disbursal-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--success-light); color: var(--success);
  border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 700; margin-top: 4px;
}
.status-disbursal-badge svg { width: 14px; height: 14px; }
.progress-list { display: flex; flex-direction: column; }
.progress-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; }
.progress-icon-col { display: flex; flex-direction: column; align-items: center; }
.progress-dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.progress-dot.done { background: var(--success); }
.progress-dot.current { background: var(--primary); }
.progress-dot.pending { background: #e5e7eb; }
.progress-dot svg { width: 16px; height: 16px; color: #fff; }
.progress-dot.current svg { color: var(--dark); }
.progress-line { width: 2px; flex: 1; min-height: 18px; background: #e5e7eb; margin-top: 4px; }
.progress-line.done { background: var(--success); }
.progress-content { flex: 1; padding-top: 6px; }
.progress-label { font-size: 14px; font-weight: 700; }
.progress-label.done { color: var(--success); }
.progress-label.current { color: var(--primary-dark); }
.progress-label.pending { color: var(--text3); }
.progress-status { font-size: 12px; color: var(--text3); margin-top: 1px; }
.progress-status.done { color: var(--success); }
.progress-status.current { color: var(--primary-dark); }
.approved-summary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius); padding: 20px 18px;
  margin: 0 14px;
}
.approved-summary-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(26,26,46,0.6); }
.approved-summary-amount { font-size: 32px; font-weight: 900; color: var(--dark); margin: 4px 0; }
.approved-summary-emi { font-size: 13px; color: rgba(26,26,46,0.7); }

/* ===== TOAST ===== */
#toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  min-width: 300px; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--white); box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  font-size: 14px; font-weight: 600; pointer-events: all;
  animation: slideDown 0.3s ease; border-left: 4px solid;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--info); }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }
.toast-msg { flex: 1; color: var(--text); }
.toast-close { background: none; border: none; cursor: pointer; color: var(--text3); padding: 2px; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* ===== MISC ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); padding: 0 18px; margin: 20px 0 10px; }
.trust-section { padding: 16px 14px; }
.trust-logos { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust-logo {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--white); border-radius: var(--radius-sm); padding: 14px 18px;
  box-shadow: var(--shadow); min-width: 80px;
}
.trust-logo svg { width: 30px; height: 30px; color: var(--text2); }
.trust-logo span { font-size: 11px; font-weight: 700; color: var(--text3); }
.terms-text { font-size: 12px; color: var(--text3); text-align: center; padding: 0 18px; line-height: 1.6; }
.login-link { font-size: 14px; color: var(--text2); text-align: center; margin-top: 14px; }
.login-link a { color: var(--primary-dark); font-weight: 700; text-decoration: none; }
.page-title-section { background: var(--primary); padding: 20px 18px 36px; }
.page-title { font-size: 22px; font-weight: 800; color: var(--dark); }
.page-subtitle { font-size: 13px; color: rgba(26,26,46,0.6); margin-top: 3px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text3); }
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 14px; color: #d1d5db; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }
.loader-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.85);
  z-index: 9998; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.loader-overlay.show { display: flex; }
.loader-spinner {
  width: 48px; height: 48px; border: 4px solid var(--primary-light);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--error-light); color: var(--error); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: #f3f4f6; color: var(--text3); }
.badge-orange { background: #fff7ed; color: #ea580c; }
.badge-green { background: var(--success-light); color: var(--success); }
.announcement-bar {
  background: var(--dark); color: var(--primary); padding: 10px 18px;
  font-size: 13px; font-weight: 600; display: flex; align-items: center;
  gap: 8px; overflow: hidden;
}
.announcement-bar svg { width: 16px; height: 16px; flex-shrink: 0; }
.ticket-card {
  background: var(--white); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
}
.ticket-card.open { border-color: var(--info); }
.ticket-card.in_progress { border-color: var(--warning); }
.ticket-card.resolved, .ticket-card.closed { border-color: var(--success); }
