:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --success-color: #059669;
  --danger-color: #dc2626;
  --warning-color: #d97706;
  --info-color: #0891b2;
  --light-bg: #f8fafc;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  width: 100%;
  max-width: 450px;
}

.login-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  padding: 2rem;
  text-align: center;
  color: white;
}

.login-header h4 {
  margin: 0;
  font-weight: 600;
  font-size: 1.5rem;
}

.login-body {
  padding: 2rem;
}

.nav-tabs {
  border: none;
  margin-bottom: 2rem;
}

.nav-tabs .nav-link {
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  margin-right: 0.5rem;
  color: #6b7280;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.nav-tabs .nav-link.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.form-control {
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
  border-radius: var(--border-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #047857 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #b91c1c 100%);
  color: white;
}

.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #ecfdf5;
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: #fef2f2;
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-warning {
  background: #fffbeb;
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

.alert-info {
  background: #f0f9ff;
  color: var(--info-color);
  border-left: 4px solid var(--info-color);
}

.dashboard-container {
  background: var(--light-bg);
  min-height: 100vh;
  padding: 2rem 0;
}

.dashboard-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.dashboard-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 1.5rem 2rem;
}

.dashboard-header h5 {
  margin: 0;
  font-weight: 600;
}

.table-container {
  padding: 2rem;
}

.table {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table thead th {
  background: #f8fafc;
  border: none;
  font-weight: 600;
  color: #374151;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  border-color: #f3f4f6;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f9fafb;
}

.edit-app {
  color: var(--success-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.edit-app:hover {
  color: #047857;
  text-decoration: underline;
}

.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  background: var(--light-bg);
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 2rem;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  background: var(--light-bg);
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem 2rem;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

.email-status {
  font-size: 0.875rem;
  font-weight: 500;
}

.info-item {
  margin-bottom: 1rem;
}

.info-item strong {
  display: block;
  color: #374151;
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .login-container {
    padding: 10px;
  }

  .login-card {
    margin: 0;
  }

  .login-header,
  .login-body {
    padding: 1.5rem;
  }

  .table-container {
    padding: 1rem;
  }

  .dashboard-header {
    padding: 1rem 1.5rem;
  }
}

.loading-overlay {
  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: 9999;
}

.loading-spinner {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
}

/* Step Indicator Styles */
.step-indicator {
  margin-bottom: 2rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.step-title {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  text-align: center;
}

.step.active .step-number {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

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

.step.completed .step-number {
  background: var(--success-color);
  color: white;
}

.step.completed .step-title {
  color: var(--success-color);
}

.step.completed .step-number::after {
  content: "✓";
  font-size: 0.875rem;
}

.step-line {
  height: 2px;
  background: #e5e7eb;
  flex: 1;
  margin: 0 0.5rem;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.step.completed + .step-line {
  background: var(--success-color);
}

.step.active + .step-line {
  background: linear-gradient(to right, var(--primary-color) 0%, #e5e7eb 100%);
}

/* Step Section Animations */
.step-section {
  animation: fadeInUp 0.5s ease-out;
}

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

/* Enhanced Card Styles */
.card-header {
  border-bottom: 2px solid #f3f4f6;
}

.card-header h6 {
  font-weight: 600;
  color: #374151;
}

.card-header.bg-warning h6 {
  color: #92400e !important;
}

.card-header.bg-success h6 {
  color: white !important;
}

.card-header.bg-primary h6 {
  color: white !important;
}

/* Button Loading States */
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Status Messages */
#application_status_msg,
#family_status_msg,
#member_status_msg,
#otp_status_msg,
#bank_update_msg,
#quick_update_msg {
  font-weight: 500;
  font-size: 0.875rem;
}

/* Verification Result */
#verification_result .alert {
  border: none;
  border-radius: 12px;
}

#verification_result .alert-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-left: 4px solid var(--success-color);
}

/* Bank Details Form */
.step-6 .form-control {
  border: 2px solid #e5e7eb;
}

.step-6 .form-control:focus {
  border-color: var(--warning-color);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.step-6 .btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #047857 100%);
}

.step-6 .btn-outline-secondary {
  border: 2px solid #6b7280;
  color: #6b7280;
}

.step-6 .btn-outline-secondary:hover {
  background: #6b7280;
  color: white;
}

/* Required field indicator */
.text-danger {
  color: var(--danger-color) !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .step-indicator .d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .step {
    flex: 0 0 auto;
    min-width: 60px;
  }

  .step-line {
    display: none;
  }

  .step-title {
    font-size: 0.7rem;
  }

  .step-number {
    width: 35px;
    height: 35px;
    font-size: 0.875rem;
  }
}

/* Back Button */
#back_button {
  border: 2px solid #6b7280;
  color: #6b7280;
  font-weight: 500;
  transition: all 0.3s ease;
}

#back_button:hover {
  background: #6b7280;
  color: white;
  transform: translateX(-2px);
}

/* Form validation styles */
.form-control.is-invalid {
  border-color: var(--danger-color);
}

.form-control.is-valid {
  border-color: var(--success-color);
}

/* Gap utility for buttons */
.d-flex.gap-2 > * + * {
  margin-left: 0.5rem;
}

/* File Upload Styles */
.upload-container {
  background: #f8fafc;
  border: 2px dashed #d1d5db;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.upload-container:hover {
  border-color: var(--primary-color);
  background: #f0f9ff;
}

.upload-container .form-control[type="file"] {
  border: 1px solid #d1d5db;
  background: white;
}

.upload-container .form-control[type="file"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.form-text {
  color: #6b7280;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* File Preview Styles */
#bank_document_preview .alert,
#cheque_document_preview .alert {
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
}

#bank_document_preview .alert-success,
#cheque_document_preview .alert-success {
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  color: #065f46;
}

.btn-outline-danger {
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
  background: transparent;
}

.btn-outline-danger:hover {
  background: var(--danger-color);
  color: white;
}

/* Checkbox Styles */
.form-check {
  padding-left: 1.5rem;
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  margin-left: -1.5rem;
  border: 2px solid #d1d5db;
  border-radius: 0.25rem;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-label {
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}

/* Animation for file upload sections */
#bank_document_upload,
#cheque_document_upload {
  overflow: hidden;
}

/* File size and type indicators */
.file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.file-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 0.375rem;
  color: #6b7280;
}

/* Option Cards Styles */
.option-card {
  margin-bottom: 1rem;
}

.option-card .card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.option-card .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.option-card .card.border-success:hover {
  box-shadow: 0 8px 25px rgba(5, 150, 105, 0.2);
}

.option-card .card.border-primary:hover {
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
}

.option-icon {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quick Mobile Update Styles */
.step-1b .form-control[readonly] {
  background-color: #f8fafc;
  border-color: #d1d5db;
  color: #6b7280;
}

/* Responsive file upload */
@media (max-width: 768px) {
  .upload-container {
    padding: 1rem;
  }

  #bank_document_preview .d-flex,
  #cheque_document_preview .d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }

  #bank_document_preview .ms-auto,
  #cheque_document_preview .ms-auto {
    margin-left: 0 !important;
    align-self: flex-start;
  }

  .option-card .card-body {
    padding: 1rem;
  }

  .option-icon {
    height: 60px;
  }

  .option-icon .display-4 {
    font-size: 2rem;
  }
}
