* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --success-color: #16a34a;
  --warning-color: #ca8a04;
  --danger-color: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

html,
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(to bottom right, #eff6ff, #f3f4f6);
  color: var(--gray-900);
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* Header */
.header {
  background: white;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bank-icon {
  font-size: 2rem;
}

.brand-text h1 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.brand-text p {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Main Content */
.main-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Dashboard */
.dashboard-section {
  text-align: center;
  margin-bottom: 3rem;
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.dashboard-section h2 {
  font-size: 2.25rem;
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.tagline {
  font-size: 1.25rem;
  color: var(--gray-600);
  max-width: 48rem;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 3rem;
  margin: 2px;
}

.feature-card {
  background: white;
  border-radius: 16px;              /* smooth edges */
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);  /* soft shadow */
  border: 1px solid #e5e7eb;        /* light border */
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.cta-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  text-align: center;
  margin-bottom: 2rem;
}

.cta-content h3 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.cta-content p {
  color: var(--gray-600);
  margin-bottom: 2rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.footer-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 2rem;
}

.footer-text p {
  margin: 0.25rem 0;
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-back {
  display: flex;
  align-items: center;
  color: var(--primary-color);
  background: none;
  border: none;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  padding: 0;
}

.btn-back:hover {
  color: var(--primary-dark);
}

/* Form */
.form-container {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.form-container h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.form-intro {
  color: var(--gray-600);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.form-section {
  background: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section h3 {
  font-size: 1.125rem;
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.required {
  color: var(--danger-color);
}

.form-group input,
.form-group select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: ring-color 0.2s ease, border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  grid: 2px var(--primary-color);
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input.error,
.form-group select.error {
  border-color: var(--danger-color);
}

.error-msg {
  font-size: 0.75rem;
  color: var(--danger-color);
  margin-top: 0.25rem;
  min-height: 1.25rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
  margin-top: 1rem;
}

/* Results Page */
.results-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.decision-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.decision-card.approved {
  background: #f0fdf4;
  border-color: var(--success-color);
}

.decision-card.rejected {
  background: #fef2f2;
  border-color: var(--danger-color);
}

.decision-card.conditional {
  background: #fffbeb;
  border-color: var(--warning-color);
}

.decision-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.decision-card h2 {
  font-size: 1.875rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.decision-card.approved h2 {
  color: var(--success-color);
}

.decision-card.rejected h2 {
  color: var(--danger-color);
}

.decision-card.conditional h2 {
  color: var(--warning-color);
}

.risk-badge-container {
  display: flex;
  justify-content: center;
}

.risk-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: bold;
  border: 1px solid;
}

.risk-badge.low {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.risk-badge.medium {
  background: #fef08a;
  color: #713f12;
  border-color: #fde047;
}

.risk-badge.high {
  background: #fee2e2;
  color: #7c2d12;
  border-color: #fecaca;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.results-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.results-card h3 {
  font-size: 1.125rem;
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.summary-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.info-row .label {
  color: var(--gray-600);
  font-size: 0.875rem;
}

.info-row .value {
  font-weight: bold;
  color: var(--gray-900);
  text-align: right;
}

.probability-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.probability-number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
}

.probability-number span:first-child {
  font-size: 3.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.probability-number.low {
  color: var(--danger-color);
}

.probability-number.medium {
  color: var(--warning-color);
}

.probability-number.high {
  color: var(--success-color);
}

.percent-sign {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.probability-number.low .percent-sign {
  color: var(--danger-color);
}

.probability-number.medium .percent-sign {
  color: var(--warning-color);
}

.probability-number.high .percent-sign {
  color: var(--success-color);
}

.probability-bar-container {
  width: 100%;
  height: 1rem;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.probability-bar {
  height: 100%;
  background: var(--primary-color);
  border-radius: 9999px;
  transition: width 1s ease;
}

.probability-bar.low {
  background: var(--danger-color);
}

.probability-bar.medium {
  background: var(--warning-color);
}

.probability-bar.high {
  background: var(--success-color);
}

.probability-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
}

.legend-item {
  text-align: center;
}

.legend-item .label {
  font-weight: bold;
  color: var(--gray-900);
  font-size: 0.875rem;
}

.legend-item .range {
  font-size: 0.75rem;
  color: var(--gray-600);
}

/* Credit Score Gauge */
.credit-score-gauge {
  position: relative;
}

.gauge-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
  text-align: center;
}

.scale-label {
  flex: 1;
}

.red-label {
  color: var(--danger-color);
}

.yellow-label {
  color: var(--warning-color);
}

.green-label {
  color: var(--success-color);
}

.blue-label {
  color: var(--primary-color);
}

.gauge-bar {
  display: flex;
  height: 2rem;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.gauge-red {
  flex: 1;
  background: var(--danger-color);
}

.gauge-yellow {
  flex: 1;
  background: var(--warning-color);
}

.gauge-green {
  flex: 1;
  background: var(--success-color);
}

.gauge-blue {
  flex: 1;
  background: var(--primary-color);
}

.gauge-pointer {
  position: absolute;
  top: 2.5rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: left 1s ease;
}

.pointer-arrow {
  width: 0;
  height: 0;
  border-left: 0.5rem solid transparent;
  border-right: 0.5rem solid transparent;
  border-top: 0.5rem solid var(--gray-900);
  margin-bottom: 0.25rem;
}

.pointer-value {
  background: var(--gray-900);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
}

.results-card p {
  color: var(--gray-700);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Risk Factors */
.risk-factors-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.risk-factor {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: 0.375rem;
  border: 1px solid var(--gray-200);
}

.risk-factor-number {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.risk-factor-text {
  color: var(--gray-700);
  font-size: 0.95rem;
}

.results-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }

  .dashboard-section h2 {
    font-size: 1.75rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .form-container {
    padding: 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .results-nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .probability-legend {
    gap: 0.5rem;
  }

  .gauge-scale {
    font-size: 0.65rem;
  }

  .probability-number span:first-child {
    font-size: 2.5rem;
  }

  .decision-icon {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .header-brand {
    gap: 0.5rem;
  }

  .brand-text h1 {
    font-size: 1.25rem;
  }

  .dashboard-section h2 {
    font-size: 1.5rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .cta-section {
    padding: 1rem;
  }

  .probability-number span:first-child {
    font-size: 2rem;
  }

  .decision-card {
    padding: 1rem;
  }
}

/* Bank Logos Section */
.bank-logos-section {
  text-align: center;
  margin-bottom: 3rem;
}

.trusted-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
  color: var(--gray-900);
}

.bank-logos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  align-items: center;
}

.bank-logo-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bank-logo-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.bank-logo-card img {
  height: 40px;      /* smaller size */
  width: auto;
  object-fit: contain;
  margin-bottom: 0.8rem;
}


.bank-logo-card p {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* Selected Bank Display */
.selected-bank-display {
  text-align: center;
  margin-bottom: 1.5rem;
}

.selected-bank-display img {
  height: 50px;
  margin-bottom: 0.5rem;
  object-fit: contain;
}

.selected-bank-display h3 {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--gray-900);
}



.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid var(--gray-200);
  padding: 0.75rem;
  text-align: center;
}

.comparison-table th {
  background: var(--gray-100);
  font-weight: bold;
}

.comparison-table tr:hover {
  background: var(--gray-50);
}

.bank-logo-card:hover {
  transform: scale(1.08);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.dashboard-section h2 {
  color: #111827;
}

.dashboard-section p {
  color: #4b5563;
}

.page {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.loader {
  border: 5px solid #eee;
  border-top: 5px solid #2563eb;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width 1s ease;
}

.bank-logo-card.selected {
  border: 2px solid #2563eb;
  transform: scale(1.05);
}

.hidden {
  display: none !important;
}

.form-group input {
  transition: all 0.3s ease;
}

.form-group input:focus {
  transform: scale(1.02);
}