/* Global Variables and Dark System Tokens */
:root {
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 28, 45, 0.45);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-card-hover: rgba(255, 255, 255, 0.12);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Status Colors */
  --pending-color: #fbbf24;
  --pending-bg: rgba(245, 158, 11, 0.12);
  --pending-border: rgba(245, 158, 11, 0.25);
  
  --verified-color: #10b981;
  --verified-bg: rgba(16, 185, 129, 0.12);
  --verified-border: rgba(16, 185, 129, 0.25);
  
  /* Accent Categories */
  --color-aadhaar: #38bdf8;
  --color-pan: #f59e0b;
  --color-gst: #10b981;
  --color-bank: #8b5cf6;
  --color-dl: #06b6d4;
  --color-uan: #f97316;
  --color-esi: #ef4444;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Background Glowing Blurs */
.glow-bg {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.22;
  pointer-events: none;
}

.glow-1 {
  background: radial-gradient(circle, var(--color-bank) 0%, rgba(0,0,0,0) 70%);
  top: -100px;
  right: -50px;
}

.glow-2 {
  background: radial-gradient(circle, var(--color-aadhaar) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px;
  left: -100px;
}

/* Container Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-bank);
  background: linear-gradient(135deg, var(--color-bank), var(--color-aadhaar));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

.logo-icon {
  stroke: var(--color-bank);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
}

.portal-title {
  font-family: var(--font-title);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Document Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

/* Verification Cards */
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 1.25rem;
  padding: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 240px;
}

.doc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.3s ease;
}

.doc-card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: var(--border-card-hover);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* Hover Accent Colors per Card */
#card-aadhaar:hover::before { background: var(--color-aadhaar); }
#card-pan:hover::before { background: var(--color-pan); }
#card-gst:hover::before { background: var(--color-gst); }
#card-bank:hover::before { background: var(--color-bank); }
#card-dl:hover::before { background: var(--color-dl); }
#card-uan:hover::before { background: var(--color-uan); }
#card-esi:hover::before { background: var(--color-esi); }

/* Verified Glowing Cards */
.doc-card.verified {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 20px -5px rgba(16, 185, 129, 0.15);
}

.doc-card.verified::before {
  background: var(--verified-color) !important;
}

/* Card Header */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.doc-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.doc-card:hover .doc-icon-wrapper {
  transform: scale(1.08);
}

/* Accent Icon Backgrounds */
.color-aadhaar { background: rgba(56, 189, 248, 0.12); color: var(--color-aadhaar); }
.color-pan { background: rgba(245, 158, 11, 0.12); color: var(--color-pan); }
.color-gst { background: rgba(16, 185, 129, 0.12); color: var(--color-gst); }
.color-bank { background: rgba(139, 92, 246, 0.12); color: var(--color-bank); }
.color-dl { background: rgba(6, 182, 212, 0.12); color: var(--color-dl); }
.color-uan { background: rgba(249, 115, 22, 0.12); color: var(--color-uan); }
.color-esi { background: rgba(239, 68, 68, 0.12); color: var(--color-esi); }

/* Status Badges */
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pending {
  background: var(--pending-bg);
  color: var(--pending-color);
  border: 1px solid var(--pending-border);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.05);
}

.status-verified {
  background: var(--verified-bg);
  color: var(--verified-color);
  border: 1px solid var(--verified-border);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
}

/* Card Titles */
.doc-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.doc-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: auto;
}

.doc-footer {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.doc-card:hover .action-link {
  color: var(--text-primary);
}

.doc-card.verified .action-link {
  color: var(--verified-color);
}

/* ==========================================
   DYNAMIC MODAL & OVERLAY SYSTEM
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  width: 520px;
  max-width: 90%;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  max-height: 90vh;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* Modal Header Content */
.modal-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.modal-icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

/* Error Banner styling */
.error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

/* Step Views Control */
.step-view {
  display: none;
}

.step-view.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

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

/* ==========================================
   FORM INPUT STYLINGS & FIELDS
   ========================================== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.input-field {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--color-bank);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Checkbox Consent Container */
.consent-container {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
  cursor: pointer;
}

.consent-checkbox {
  appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  outline: none;
  cursor: pointer;
  position: relative;
  background: transparent;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.consent-checkbox:checked {
  background: var(--color-gst);
  border-color: var(--color-gst);
}

.consent-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 0.12rem;
  width: 0.3rem;
  height: 0.55rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  user-select: none;
}

/* Submit Buttons */
.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--color-bank) 0%, var(--color-aadhaar) 100%);
  border: none;
  border-radius: 0.75rem;
  color: white;
  padding: 1rem;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

/* Dynamic spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   OTP VERIFICATION INPUTS
   ========================================== */
.otp-instruction {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.otp-inputs-wrapper {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.otp-input-box {
  width: 3.25rem;
  height: 3.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  transition: all 0.2s ease;
}

.otp-input-box:focus {
  outline: none;
  background: rgba(15, 23, 42, 0.9);
  border-color: var(--color-bank);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.otp-resend-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.timer-text {
  color: var(--text-muted);
}

.resend-action-btn {
  background: none;
  border: none;
  color: var(--color-aadhaar);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.resend-action-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  text-decoration: none;
}

/* ==========================================
   SUCCESS CARD & PROFILE RENDERING
   ========================================== */
.profile-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.profile-avatar-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}

.profile-avatar {
  width: 7rem;
  height: 8.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.avatar-placeholder {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bank);
  border: 1.5px dashed rgba(255, 255, 255, 0.1);
}

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 0.6rem;
  font-size: 0.9rem;
}

.profile-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.profile-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.profile-val {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  word-wrap: break-word;
}

/* OK Confirm Success Button */
.ok-confirm-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 0.75rem;
  color: white;
  padding: 1.1rem;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
}

.ok-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -5px rgba(16, 185, 129, 0.55);
}

.ok-confirm-btn:active {
  transform: translateY(0);
}

/* Mock Warning Badge */
.mock-warning-badge {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: center;
  line-height: 1.4;
  animation: fadeIn 0.3s ease;
}

/* Profile Section Header for Input vs API Details */
.profile-section-header {
  margin-top: 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 0.35rem;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .container {
    padding: 2rem 1rem;
  }
  .portal-title {
    font-size: 2rem;
  }
  .grid-container {
    grid-template-columns: 1fr;
  }
  .modal-card {
    padding: 1.5rem;
  }
}
