/* ============================================================
   UPLOANMITRA — Forms, Wizards, Calculator, Apply Flow
   ============================================================ */

/* ── Full Calculator Page ── */
.calc-page-hero {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  padding: clamp(4rem, 8vw, 6rem) 0;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.calc-page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

.calc-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: var(--space-10);
  align-items: start;
}

@media (max-width: 1100px) { .calc-layout { grid-template-columns: 1fr; } }

.calc-inputs-panel {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 100px;
}

.calc-inputs-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.calc-results-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Result Summary Cards */
.calc-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 900px) { .calc-summary-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .calc-summary-cards { grid-template-columns: 1fr; } }

.calc-summary-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.calc-summary-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  transition: background var(--duration-normal) var(--ease-out);
}

.calc-summary-card--emi::after    { background: var(--color-primary); }
.calc-summary-card--principal::after { background: var(--color-gold); }
.calc-summary-card--interest::after  { background: var(--color-error); }
.calc-summary-card--total::after     { background: var(--color-success); }

.calc-summary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.calc-summary-label {
  font-size: 0.65rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.calc-summary-value {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl));
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 2px;
}

.calc-summary-value.primary { color: var(--color-primary); }
.calc-summary-value.gold    { color: var(--color-gold-dark); }
.calc-summary-value.danger  { color: var(--color-error); }
.calc-summary-value.success { color: var(--color-success); }

.calc-summary-sub {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

/* Charts Area */
.calc-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

@media (max-width: 768px) { .calc-charts-row { grid-template-columns: 1fr; } }

.calc-chart-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.calc-chart-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Pie Chart */
.pie-chart-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pie-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pie-legend-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: 1px;
}

.pie-legend-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text);
}

.pie-legend-pct {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-left: 2px;
}

/* Line Chart */
.line-chart-container {
  position: relative;
  width: 100%;
  height: 200px;
}

.line-chart-container canvas {
  width: 100% !important;
  height: 200px !important;
}

/* Amortization Table */
.amort-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.amort-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.amort-tabs {
  display: flex;
  gap: var(--space-2);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
}

.amort-tab {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  background: none;
  border: none;
  font-family: var(--font-heading);
  color: var(--color-text-secondary);
}

.amort-tab.active {
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
}

.amort-actions {
  display: flex;
  gap: var(--space-3);
}

.amort-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  background: var(--color-white);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.amort-action-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-muted);
}

.amort-table-wrap {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.amort-table {
  width: 100%;
  border-collapse: collapse;
}

.amort-table th {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: right;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  z-index: 1;
}

.amort-table th:first-child { text-align: left; }

.amort-table td {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  text-align: right;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-light);
}

.amort-table td:first-child {
  text-align: left;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.amort-table tr:hover td { background: var(--color-bg); }

.amort-table .total-row td {
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-weight: var(--weight-bold);
  border-top: 2px solid var(--color-primary);
}

/* Processing Fee & Insurance */
.calc-extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 480px) { .calc-extras { grid-template-columns: 1fr; } }

.calc-extra-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.calc-extra-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  display: flex;
  justify-content: space-between;
}

.calc-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration-normal) var(--ease-out);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--duration-normal) var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Eligibility Wizard ── */
.wizard-section {
  min-height: 100vh;
  background: var(--color-bg);
  padding: var(--space-16) 0;
}

.wizard-container {
  max-width: 700px;
  margin: 0 auto;
}

.wizard-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.wizard-progress-bar {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.wizard-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.wizard-step-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-10);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .wizard-step-card { padding: var(--space-6) var(--space-6); }
}

.wizard-step-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-muted);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-4);
  margin-bottom: var(--space-5);
}

.wizard-step-title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: var(--weight-extrabold);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-3);
}

.wizard-step-sub {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  line-height: var(--leading-loose);
}

.wizard-step-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wizard-option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 480px) { .wizard-option-grid { grid-template-columns: 1fr; } }

.wizard-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  user-select: none;
}

.wizard-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-muted);
}

.wizard-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-muted);
  box-shadow: 0 0 0 3px var(--color-primary-muted);
}

.wizard-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wizard-option__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-normal) var(--ease-out);
}

.wizard-option.selected .wizard-option__icon {
  background: var(--color-primary);
  color: white;
}

.wizard-option__label {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.wizard-option__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.wizard-option__check {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-out);
}

.wizard-option.selected .wizard-option__check {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.wizard-input-large {
  width: 100%;
  padding: 1.125rem var(--space-6);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
  outline: none;
  transition: all var(--duration-normal) var(--ease-out);
  text-align: center;
}

.wizard-input-large:focus {
  border-color: var(--color-primary);
  background: var(--color-white);
  box-shadow: 0 0 0 4px var(--color-primary-muted);
}

.wizard-input-large::placeholder { color: var(--color-text-muted); font-weight: var(--weight-regular); }

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  gap: var(--space-4);
}

/* Eligibility Result */
.wizard-result-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.result-icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  animation: result-pop 0.6s var(--ease-spring) forwards;
}

@keyframes result-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.result-icon-wrap--success { background: var(--color-success-bg); color: var(--color-success); }
.result-icon-wrap--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.result-icon-wrap--review  { background: var(--color-primary-muted); color: var(--color-primary); }

.result-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.result-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-loose);
  max-width: 480px;
  margin: 0 auto var(--space-8);
}

.result-recommendations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  text-align: left;
  margin-bottom: var(--space-8);
}

@media (max-width: 640px) { .result-recommendations { grid-template-columns: 1fr; } }

.result-rec-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--duration-normal) var(--ease-out);
}

.result-rec-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.result-rec-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.result-rec-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: 2px;
}

.result-rec-rate {
  font-size: var(--text-xs);
  color: var(--color-gold-dark);
  font-weight: var(--weight-semibold);
}

/* ── Apply Flow ── */
.apply-page {
  min-height: 100vh;
  background: var(--color-bg);
  padding: var(--space-12) 0 var(--space-20);
}

.apply-container {
  max-width: 860px;
  margin: 0 auto;
}

.apply-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.apply-progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-10);
  overflow-x: auto;
  padding: var(--space-2);
}

.apply-step-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.apply-step-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  flex-shrink: 0;
}

.apply-step-bubble.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 0 0 4px var(--color-primary-muted);
}

.apply-step-bubble.done {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.apply-step-line {
  width: clamp(30px, 6vw, 60px);
  height: 2px;
  background: var(--color-border);
  transition: background var(--duration-slow) var(--ease-out);
  flex-shrink: 0;
}

.apply-step-line.done { background: var(--color-success); }

.apply-step-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.6rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-white);
  padding: 3px 8px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  pointer-events: none;
}

@media (min-width: 768px) {
  .apply-step-bubble:hover .apply-step-tooltip { display: block; }
}

.apply-form-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.apply-form-header {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  padding: var(--space-6) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.apply-form-step-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: white;
}

.apply-form-step-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.65);
}

.apply-autosave {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.65);
}

.autosave-dot {
  width: 6px;
  height: 6px;
  background: var(--color-gold);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

.apply-form-body {
  padding: var(--space-8) var(--space-8);
}

@media (max-width: 640px) {
  .apply-form-header, .apply-form-body { padding: var(--space-6); }
}

.apply-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 640px) { .apply-form-grid { grid-template-columns: 1fr; } }

.apply-form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .apply-form-grid .span-2 { grid-column: span 1; } }

.apply-form-footer {
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--color-bg);
}

@media (max-width: 640px) {
  .apply-form-footer { flex-direction: column; }
  .apply-form-footer .btn { width: 100%; }
}

/* Floating Labels */
.form-field-float {
  position: relative;
}

.form-field-float input,
.form-field-float select,
.form-field-float textarea {
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
}

.form-field-float label {
  position: absolute;
  left: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: all var(--duration-normal) var(--ease-out);
  pointer-events: none;
  background: transparent;
  line-height: 1;
}

.form-field-float input:focus ~ label,
.form-field-float input:not(:placeholder-shown) ~ label,
.form-field-float select:focus ~ label,
.form-field-float select:valid ~ label,
.form-field-float textarea:focus ~ label,
.form-field-float textarea:not(:placeholder-shown) ~ label {
  top: 0.625rem;
  transform: none;
  font-size: 0.65rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-primary);
}

/* Input Glow */
.form-input:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px var(--color-primary-muted), 0 0 12px rgba(15,61,115,0.1);
}

/* Error Shake */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-6px); }
  40%, 80%  { transform: translateX(6px); }
}

.form-input.shake,
.form-select.shake {
  animation: shake 0.4s ease-in-out;
}

/* ── OTP Input ── */
.otp-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.otp-input {
  width: 56px;
  height: 64px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  text-align: center;
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: all var(--duration-normal) var(--ease-out);
  caret-color: var(--color-primary);
}

.otp-input:focus {
  border-color: var(--color-primary);
  background: var(--color-white);
  box-shadow: 0 0 0 4px var(--color-primary-muted);
  transform: scale(1.05);
}

.otp-input.filled {
  border-color: var(--color-success);
  background: var(--color-success-bg);
  color: var(--color-success);
}

@media (max-width: 400px) {
  .otp-input { width: 44px; height: 52px; font-size: var(--text-xl); }
  .otp-container { gap: var(--space-2); }
}

.otp-timer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  justify-content: center;
  margin-top: var(--space-4);
}

.otp-timer-value {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  min-width: 3ch;
  text-align: center;
}

.otp-resend {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: none;
  text-decoration: underline;
}

.otp-success-anim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) 0;
}

.otp-check-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: result-pop 0.5s var(--ease-spring);
}

/* ── Document Upload ── */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  background: var(--color-bg);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-muted);
}

.upload-zone.drag-over { transform: scale(1.01); }

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
}

.upload-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.upload-sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.upload-formats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.upload-format-badge {
  font-size: 0.65rem;
  font-weight: var(--weight-bold);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  color: var(--color-text-secondary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.uploaded-files-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.uploaded-file-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  animation: slideInUp 0.3s var(--ease-out);
}

.file-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.file-item-info { flex: 1; min-width: 0; }

.file-item-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.file-upload-progress {
  flex: 1;
}

.file-progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.file-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
}

.file-item-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.file-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.file-action-btn:hover { background: var(--color-error-bg); color: var(--color-error); border-color: var(--color-error); }
.file-action-btn.replace:hover { background: var(--color-primary-muted); color: var(--color-primary); border-color: var(--color-primary); }

/* Review Step */
.review-section-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin: var(--space-6) 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-edit-btn {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: color var(--duration-fast) var(--ease-out);
}

.review-edit-btn:hover { color: var(--color-gold); }

.review-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
}

@media (max-width: 560px) { .review-data-grid { grid-template-columns: 1fr; } }

.review-data-item {}

.review-data-label {
  font-size: 0.65rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 3px;
}

.review-data-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

.terms-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  margin-top: var(--space-6);
  cursor: pointer;
}

.terms-checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  accent-color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.terms-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-loose);
}

.terms-text a {
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

/* ── Success Page ── */
.success-page {
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) 0;
}

.success-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-3xl);
  padding: clamp(var(--space-10), 5vw, var(--space-16));
  text-align: center;
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  box-shadow: var(--shadow-2xl);
  position: relative;
  overflow: hidden;
}

.success-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
}

.success-animation {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-8);
}

.success-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--color-success);
  animation: success-ring 0.8s var(--ease-out) forwards;
}

@keyframes success-ring {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-check-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--color-success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-success);
  animation: result-pop 0.6s var(--ease-spring) 0.3s both;
}

.success-title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: var(--weight-extrabold);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.success-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-8);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.success-ref-card {
  background: var(--color-primary-muted);
  border: 1px solid rgba(15,61,115,0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-8);
}

.success-ref-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.success-ref-number {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-primary);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.success-ref-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.success-timeline-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-10);
  overflow-x: auto;
}

.success-mini-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 70px;
}

.success-mini-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-success);
  color: white;
  font-size: var(--text-xs);
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.success-mini-bubble.pending {
  background: var(--color-border);
  color: var(--color-text-muted);
}

.success-mini-label {
  font-size: 0.6rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.3;
}

.success-mini-line {
  width: 40px;
  height: 2px;
  background: var(--color-success);
  margin-bottom: 18px;
}

.success-mini-line.pending { background: var(--color-border); }

.success-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Application Tracker ── */
.tracker-hero {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  padding: clamp(3rem, 6vw, 5rem) 0;
  color: white;
  text-align: center;
}

.tracker-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-10);
  align-items: start;
}

@media (max-width: 1024px) { .tracker-layout { grid-template-columns: 1fr; } }

.tracker-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.tracker-header {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  padding: var(--space-6) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tracker-ref {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: white;
}

.tracker-ref-num {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.65);
}

.tracker-body { padding: var(--space-8) var(--space-8); }

.tracker-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tracker-timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: var(--color-border);
  z-index: 0;
}

.tracker-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  position: relative;
  z-index: 1;
}

.tracker-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-muted);
  transition: all var(--duration-normal) var(--ease-out);
}

.tracker-item.done .tracker-dot {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
  box-shadow: 0 2px 12px rgba(16,185,129,0.3);
}

.tracker-item.active .tracker-dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 0 0 4px var(--color-primary-muted);
  animation: pulse-glow 2s ease-in-out infinite;
}

.tracker-info {}

.tracker-status {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: 3px;
}

.tracker-item.active .tracker-status { color: var(--color-primary); }
.tracker-item.done  .tracker-status   { color: var(--color-success); }

.tracker-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.tracker-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
}

.tracker-badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Loan Type Selector (Step 1 apply) ── */
.loan-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

@media (max-width: 768px) { .loan-type-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .loan-type-grid { grid-template-columns: 1fr; } }

.loan-type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-normal) var(--ease-out);
  user-select: none;
  position: relative;
}

.loan-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.loan-type-option:hover { border-color: var(--color-primary); background: var(--color-primary-muted); }

.loan-type-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-muted);
  box-shadow: 0 0 0 3px var(--color-primary-muted);
}

.loan-type-option__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-normal) var(--ease-out);
}

.loan-type-option.selected .loan-type-option__icon {
  background: var(--color-primary);
  color: white;
}

.loan-type-option__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  letter-spacing: 0.01em;
  line-height: 1.3;
}
