/* ============================================================
   Bank Bazar - Credit Card Application Form
   ============================================================ */

:root {
  /* Default theme (will be overridden by JS) */
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --primary-gradient: linear-gradient(135deg, #1a73e8, #0d47a1);
  --accent: #ff6f00;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --error: #d93025;
  --success: #0f9d58;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ============================================================
   HEADER / BANK BRANDING
   ============================================================ */

header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.bank-branding {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bank-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.bank-info h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  flex: 1;
  justify-content: center;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 60%;
  width: 80%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-step:last-child::after {
  display: none;
}

.progress-step.active::after,
.progress-step.completed::after {
  background: var(--primary);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.progress-step.active .step-number {
  background: var(--primary);
  color: #fff;
}

.progress-step.completed .step-number {
  background: var(--success);
  color: #fff;
}

.step-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   MESSAGE BANNER
   ============================================================ */

.message-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.message-banner.success {
  background: #e6f4ea;
  color: #1e7e34;
  border: 1px solid #b7e1cd;
}

.message-banner.error {
  background: #fce8e6;
  color: var(--error);
  border: 1px solid #f5c6cb;
}

.message-banner button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  color: inherit;
}

/* ============================================================
   FORM STEPS
   ============================================================ */

.form-step {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.35s ease;
}

.hidden {
  display: none !important;
}

.step-title {
  font-size: 1.2rem;
  margin-bottom: 24px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-title i {
  color: var(--primary);
}

.form-row {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text);
}

/* ============================================================
   INPUTS
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

input.error,
select.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px #fce8e6;
}

.phone-input-wrapper {
  display: flex;
  align-items: stretch;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: #f1f3f4;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.phone-input {
  border-radius: 0 8px 8px 0 !important;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   RADIO CARDS
   ============================================================ */

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.radio-card-content i {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.radio-card input:checked + .radio-card-content {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.radio-card input:checked + .radio-card-content i {
  color: var(--primary);
}

/* ============================================================
   INCOME SELECTOR
   ============================================================ */

.income-selector {
  position: relative;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
}

/* ============================================================
   ERROR MESSAGES
   ============================================================ */

.error-message {
  display: block;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
  min-height: 18px;
}

/* ============================================================
   TERMS CHECKBOX
   ============================================================ */

.terms-row {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.5;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
}

.checkbox-custom {
  min-width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  color: #fff;
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f1f3f4;
  color: var(--text);
}

.btn-secondary:hover {
  background: #e2e4e7;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

/* ============================================================
   REVIEW CARD
   ============================================================ */

.review-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.review-card h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}

.review-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #e8eaed;
}

.review-row:last-child {
  border-bottom: none;
}

.review-row span:first-child {
  color: var(--text-secondary);
}

.review-row span:last-child {
  font-weight: 500;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

/* ============================================================
   SUCCESS MODAL
   ============================================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: scaleIn 0.3s ease;
}

.success-icon {
  font-size: 3.5rem;
  color: var(--success);
  margin-bottom: 16px;
}

.modal-content h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  text-align: center;
  margin-top: 28px;
  padding: 20px;
}

.powered-by {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.powered-by i {
  color: #f5a623;
}

.powered-by strong {
  color: var(--text);
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .container {
    padding: 12px 8px;
  }

  header {
    padding: 16px;
  }

  .bank-branding {
    gap: 12px;
  }

  .bank-logo {
    width: 48px;
    height: 48px;
  }

  .bank-info h1 {
    font-size: 1.1rem;
  }

  .form-step {
    padding: 20px 16px;
  }

  .progress-step .step-label {
    display: none;
  }

  .radio-group {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .modal-content {
    padding: 28px 20px;
  }
}
