
/* ============= Global Styles ============= */
:root {
  --primary: #1a56db;
  --primary-hover: #1e429f;
  --secondary: #e5edff;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-light: #6b7280;
  --error: #ef4444;
  --success: #10b981;
  --border: #e5e7eb;
  --border-focus: #a5b4fc;
  --background: #ffffff;
  --background-light: #f9fafb;
  --background-highlight: #f3f4f6;
  --shadow: 0px 4px 10px rgba(0, 0, 0, 0.05);
  --radius: 8px;
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background-color: #f5f8ff;
  line-height: 1.5;
}

.wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.container {
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center; /* Ensure card is centered within container */
}

.home-button {
  position: absolute;
  top: 5px;
  left: 15px;
  padding: 10px 20px;
  background-color: #1a56db; /* Matches your .continue-btn color */
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.3s;
  z-index: 100; /* Ensures button is above other content */
}

.home-button:hover {
  background-color: #1a56db; /* Matches .continue-btn hover */
}

.application-card {
  background-color: var(--background);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  width: 140%; /* Fixed width for ~140px */
  margin: 0 auto;
}

.application-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.application-subtitle {
  color: var(--text-light);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* ============= Form Styles ============= */
.application-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-section {
  margin-bottom: 1rem;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.verification-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.form-group {
  width: 100%;
  position: relative;
}

.form-group.half {
  flex: 1;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--background);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(165, 180, 252, 0.3);
}

.form-input.error {
  border-color: var(--error);
}

.form-input::placeholder {
  color: #9ca3af;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-with-icon .form-input.with-icon {
  padding-left: 3rem;
}

.currency-input {
  position: relative;
}

.currency-symbol {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  z-index: 1;
}

.currency-code {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.form-input.with-currency {
  padding-left: 1.75rem;
  padding-right: 3.5rem;
}

.error-message {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.25rem;
  display: none;
}

.error-message.visible {
  display: block;
}

/* ============= Loan Type Grid ============= */
.loan-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.loan-type-option {
  background-color: var(--background-light);
  border-radius: var(--radius);
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.loan-type-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.loan-icon {
  color: var(--primary);
  padding: 0.5rem;
  border-radius: 50%;
  background-color: rgba(26, 86, 219, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loan-type-option span {
  font-size: 0.8rem;
  font-weight: 500;
}

.check-icon {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background-color: var(--primary);
  color: white;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.loan-type-option.selected .check-icon {
  display: flex;
}

/* ============= Loan Type Grid (Large) ============= */
.loan-type-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.loan-type-option-large {
  background-color: var(--background-light);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 1px solid transparent;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.loan-type-option-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.loan-type-option-large.selected {
  background-color: var(--secondary);
  border-color: var(--primary);
}

.loan-type-option-large .loan-icon {
  color: var(--primary);
  padding: 1rem;
  border-radius: 50%;
  background-color: rgba(26, 86, 219, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loan-type-option-large span {
  font-size: 1rem;
  font-weight: 500;
}

.check-icon-large {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--primary);
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.loan-type-option-large.selected .check-icon-large {
  display: flex;
}

/* ============= Terms Toggle ============= */
.terms-container {
  margin-top: 0.5rem;
}

.terms-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  gap: 10px;
}

.terms-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 10px;
  transition: .4s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}

.toggle-input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

@media (max-width: 768px) {
  .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 10px;
    transition: .4s;
    width: 36px;
}
  }
  
/* ============= Form Navigation ============= */
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

.progress-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

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

.progress-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #d1d5db;
}

.dot.active {
  background-color: var(--primary);
}

.form-nav-buttons {
  display: flex;
  gap: 0.75rem;
}

.next-button, .back-button, .verify-button, .submit-button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
}

.next-button, .submit-button {
  background-color: var(--primary);
  color: white;
}

.next-button:hover, .submit-button:hover {
  background-color: var(--primary-hover);
}

.next-button:disabled {
  background-color: #cbd5e1;
  cursor: not-allowed;
}

.back-button {
  background-color: var(--background-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.back-button:hover {
  background-color: var(--background-highlight);
}

.verify-button {
  background-color: var(--primary);
  color: white;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 200px;
}

.text-button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.5rem;
  text-decoration: underline;
}

/* ============= Verification Section ============= */
.verification-code-container {
  margin-top: 1rem;
}

.verification-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.verification-status {
  padding: 0.75rem;
  margin-top: 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-align: center;
  display: none;
}

.verification-status.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: block;
}

.verification-status.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: block;
}

/* ============= Success Message ============= */
.success-message {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  width: 6rem;
  height: 6rem;
  margin: 0 auto 1.5rem;
}

.success-check {
  width: 100%;
  height: auto;
}

.quote-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.quote-message {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
}

.close-button {
  padding: 0.75rem 6rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
  background-color: #18ca59;
  color: white;
}

.close-button:hover {
  background-color: #22c55e;
}

/* ============= Floating Animation ============= */
.progress-animation {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  height: 10px;
  align-items: center;
}

.floating-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #d1d5db;
  position: relative;
}

.floating-dot.active {
  background-color: var(--primary);
  animation: pulse 2s infinite;
}

.floating-dot:nth-child(1) {
  animation: floating 3s ease-in-out infinite;
}

.floating-dot:nth-child(2) {
  animation: floating 3s ease-in-out infinite;
  animation-delay: 0.2s;
}

.floating-dot:nth-child(3) {
  animation: floating 3s ease-in-out infinite;
  animation-delay: 0.4s;
}

.floating-dot:nth-child(4) {
  animation: floating 3s ease-in-out infinite;
  animation-delay: 0.6s;
}

.floating-dot:nth-child(5) {
  animation: floating 3s ease-in-out infinite;
  animation-delay: 0.8s;
}

@keyframes floating {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(26, 86, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 86, 219, 0);
  }
}

/* ============= Responsive Styles ============= */
@media (max-width: 600px) {
  .application-card {
    padding: 1.5rem;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .loan-type-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  
  .form-footer {
    flex-direction: column;
    gap: 1rem;
  }
  
  .progress-indicator {
    width: 100%;
    align-items: center;
    margin-bottom: 0.5rem;
  }
  
  .form-nav-buttons {
    width: 100%;
  }
  
  .back-button, .next-button, .submit-button {
    flex: 1;
    text-align: center;
  }
}

.error {
  border-color: #d9173e !important;
}

.error-message {
  color: #d9173e;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}

.loan-type-options.error {
  outline: 2px solid #d9173e;
}

@media (max-width: 768px) {
  .toggle-switch {
    position: relative;
    width: 106px;
    height: 20px;
  }
}
