:root {
  --primary-navy: #13294b;
  --accent-gold: #c59b27;
  --accent-saffron: #e65100;
  --gov-green: #1b5e20;
  --gov-green-light: #e8f5e9;
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 18px rgba(19, 41, 75, 0.08);
  --shadow-lg: 0 12px 28px rgba(19, 41, 75, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Noto Sans Gujarati', 'Shruti', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background: var(--primary-navy);
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--accent-gold);
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.emblem-icon {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  padding: 3px;
  overflow: hidden;
}

.emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-titles h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.brand-titles p {
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* Main Container */
.main-wrapper {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Auth Card */
.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(203, 213, 225, 0.6);
  max-width: 460px;
  margin: 1rem auto;
  text-align: center;
}

.badge-tag {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1rem;
  border: 1px solid #fde68a;
}

.auth-card h2 {
  font-size: 1.4rem;
  color: var(--primary-navy);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.auth-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

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

.input-prefix-box {
  display: flex;
  align-items: center;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  transition: border-color 0.2s;
}

.input-prefix-box:focus-within {
  border-color: var(--accent-saffron);
}

.prefix {
  padding: 0 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f8fafc;
  border-right: 1px solid var(--border-color);
  line-height: 48px;
}

.input-field {
  width: 100%;
  border: none;
  padding: 12px 14px;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  color: var(--text-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-otp {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  letter-spacing: 6px;
  font-size: 1.3rem;
  text-align: center;
  font-weight: 700;
}

.input-otp:focus {
  border-color: var(--accent-saffron);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-saffron) 0%, #d84315 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 10px rgba(230, 81, 0, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(230, 81, 0, 0.35);
}

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

.btn-secondary {
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--primary-navy);
  background: #e2e8f0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

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

.btn-outline {
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Demo Notice Banner */
.demo-banner {
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #92400e;
  animation: fadeIn 0.3s ease-in;
}

.demo-code {
  font-size: 1.25rem;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 3px;
  margin-top: 4px;
}

/* Alerts */
.msg-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: none;
}

.msg-error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.msg-success {
  display: block;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Card Presentation */
.cards-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.cards-toolbar h2 {
  font-size: 1.3rem;
  color: var(--primary-navy);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.card-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Physical Aadhar Card Style */
.aadhar-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid #cbd5e1;
  overflow: hidden;
  position: relative;
  page-break-inside: avoid;
  max-width: 650px;
  margin: 0 auto;
  width: 100%;
}

.card-banner {
  background: linear-gradient(90deg, #13294b 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2.5px solid var(--accent-gold);
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-emblem {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.banner-emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.banner-text .gov-title {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-weight: 600;
}

.banner-text .card-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.banner-tag {
  font-size: 0.65rem;
  background: rgba(197, 155, 39, 0.25);
  border: 1px solid var(--accent-gold);
  color: #fef08a;
  padding: 3px 8px;
  border-radius: 12px;
  text-align: right;
}

.card-content {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 16px;
  background: #fafafa;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item {
  font-size: 0.88rem;
  color: var(--text-dark);
}

.info-label {
  font-weight: 600;
  color: #475569;
  display: inline-block;
  min-width: 110px;
}

.info-value {
  font-weight: 700;
  color: #0f172a;
}

.card-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #ffffff;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-qr-box svg {
  width: 115px;
  height: 115px;
}

.qr-caption {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Card Species Table */
.card-table-wrapper {
  padding: 0 20px 14px 20px;
  background: #fafafa;
}

.card-species-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.card-species-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.card-species-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.card-species-table tr.total-row {
  background: #f8fafc;
  font-weight: 800;
  border-top: 1.5px solid #cbd5e1;
}

.card-footer-band {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-id-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: 2px;
}

.card-verify-note {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Verification Page Specifics */
.verify-page {
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.verify-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid #e2e8f0;
  text-align: center;
}

.badge-success {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gov-green-light);
  color: var(--gov-green);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 18px;
  border-radius: 30px;
  margin-bottom: 1rem;
  border: 1px solid #a7f3d0;
}

.card-id-highlight {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-navy);
  background: #f1f5f9;
  display: inline-block;
  padding: 6px 16px;
  border-radius: 8px;
  margin: 10px 0 20px 0;
  letter-spacing: 2px;
}

.verify-details {
  text-align: left;
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 1.5rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.92rem;
}

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

.species-summary {
  margin-bottom: 1.5rem;
  text-align: left;
}

.species-summary h3 {
  font-size: 0.95rem;
  color: var(--primary-navy);
  margin-bottom: 8px;
}

.species-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.species-table th, .species-table td {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
}

.species-table th {
  background: #f8fafc;
}

.privacy-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
  .auth-card {
    padding: 1.5rem;
  }
  .card-content {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .card-qr-box {
    margin-top: 10px;
  }
  .card-footer-band {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

/* ===================================================
   Print Stylesheet (Target: A5 Landscape, exact card)
   =================================================== */
@media print {
  @page {
    size: A5 landscape;
    margin: 10mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .app-header,
  .cards-toolbar,
  .btn-primary,
  .btn-secondary,
  .btn-outline,
  .demo-banner,
  .msg-box,
  footer {
    display: none !important;
  }

  .main-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .aadhar-card {
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    page-break-after: always;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .card-banner {
    background: #13294b !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .card-content {
    background: #ffffff !important;
  }

  .card-species-table th {
    background: #e2e8f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
