/* PULSE-R24 ADMIN LOGIN - NIC / CERT-In INDIAN SECURITY STANDARDS STYLING */
:root {
  --primary-red: #8b0000;
  --primary-red-hover: #700000;
  --primary-navy: #0b1526;
  --bg-gradient-start: #f6f8fb;
  --bg-gradient-end: #e7eef7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --input-bg: #f1f5f9;
  --input-border: #e2e8f0;
  --input-focus: #0f172a;
  --border-radius-card: 20px;
  --border-radius-input: 10px;
  --shadow-card: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(15, 23, 42, 0.04);
}

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

body.login-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  background-color: #f3f6fa;
  background-image: 
    linear-gradient(to right, rgba(11, 21, 38, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11, 21, 38, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 24px 16px 40px;
}

/* Subtle outer vignette */
.security-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.7) 0%, rgba(230, 238, 248, 0.6) 80%, rgba(200, 214, 235, 0.8) 100%);
  z-index: 0;
}

/* Back link */
.login-top-nav {
  width: 100%;
  max-width: 440px;
  margin-bottom: 24px;
  position: relative;
  z-index: 10;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  color: var(--primary-red);
  transform: translateX(-3px);
}

/* Main Login Container */
.login-wrapper {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 10;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 36px 32px 28px;
  position: relative;
  overflow: hidden;
}

/* Crimson Top Accent Bar */
.card-crimson-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8b0000 0%, #b91c1c 100%);
}

/* Brand Header */
.brand-header {
  text-align: center;
  margin-bottom: 22px;
}

.brand-shield-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #8b0000 0%, #660000 100%);
  color: #ffffff;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(139, 0, 0, 0.25);
}

.brand-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #0b1526;
  line-height: 1.1;
}

.brand-title sup {
  font-size: 14px;
  font-weight: 800;
  color: #8b0000;
  margin-left: 2px;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #64748b;
  margin-top: 6px;
  text-transform: uppercase;
}

/* Compliance Badge */
.compliance-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 22px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #334155;
}

.compliance-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* Alerts */
.login-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease-out;
}
.login-alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.login-alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

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

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #475569;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s;
}

.form-input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  font-size: 13.5px;
  font-family: inherit;
  color: #0f172a;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-input);
  outline: none;
  transition: all 0.2s ease;
}

.form-input::placeholder {
  color: #94a3b8;
  font-size: 13px;
}

.form-input:focus {
  background: #ffffff;
  border-color: #0b1526;
  box-shadow: 0 0 0 3px rgba(11, 21, 38, 0.08);
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle:hover {
  color: #475569;
}
.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Captcha Component */
.captcha-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  gap: 10px;
}

.captcha-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.captcha-hint {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.captcha-box-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.captcha-canvas-wrapper {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

#captchaCanvas {
  display: block;
  cursor: default;
}

.captcha-refresh-btn,
.captcha-audio-btn {
  width: 44px;
  height: 46px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  transition: all 0.2s ease;
}

.captcha-refresh-btn svg,
.captcha-audio-btn svg {
  width: 19px;
  height: 19px;
}

.captcha-refresh-btn:hover,
.captcha-audio-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0b1526;
  transform: translateY(-1px);
}

.captcha-refresh-btn:active svg {
  transform: rotate(180deg);
  transition: transform 0.3s;
}

.captcha-input-wrap .form-input {
  letter-spacing: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  background: var(--primary-red);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: var(--border-radius-input);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.25);
  margin-top: 4px;
}

.submit-btn:hover {
  background: var(--primary-red-hover);
  box-shadow: 0 6px 16px rgba(139, 0, 0, 0.35);
  transform: translateY(-1px);
}

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

/* Quick Access Divider */
.quick-access-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 16px;
  text-align: center;
}

.quick-access-divider::before,
.quick-access-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.quick-access-divider span {
  padding: 0 12px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #94a3b8;
}

/* Demo Login Button */
.demo-login-btn {
  width: 100%;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 12px;
  border-radius: var(--border-radius-input);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.demo-login-btn svg {
  width: 14px;
  height: 14px;
  fill: #8b0000;
  color: #8b0000;
}

.demo-login-btn:hover {
  background: #cbd5e1;
  color: #0b1526;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* Notice Footer */
.card-footer-notice {
  text-align: center;
  margin-top: 24px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #94a3b8;
}

/* Govt Legal Disclaimer */
.gov-disclaimer {
  margin-top: 22px;
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
  color: #64748b;
  max-width: 440px;
  padding: 0 10px;
}

.gov-disclaimer p + p {
  margin-top: 4px;
}

.gov-disclaimer strong {
  color: #334155;
  font-weight: 700;
}

/* Preserve the complete security challenge on narrow screens. */
.captcha-box-container { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; }
.captcha-canvas-wrapper { min-width: 0; }
.captcha-canvas-wrapper canvas { display: block; width: 100%; max-width: 170px; height: 46px; }
.captcha-label-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.captcha-label-row > * { min-width: 0; }
.captcha-label-row .captcha-hint { max-width: 110px; text-align: right; }
#adminPassword { padding-right: 48px; }
.password-toggle { width: 44px; height: 44px; right: 3px; }
body.login-body .login-top-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.login-top-nav .back-link { min-width: 0; letter-spacing: 0; }
.login-top-nav .back-link svg { flex-shrink: 0; }
@media (max-width: 600px) {
  body.login-body { padding: 18px 12px 32px; }
  .login-card { padding: 28px 20px 24px; }
  .form-input, .captcha-input-wrap .form-input { font-size: 16px; min-height: 48px; }
  .captcha-group { padding: 12px; }
  .form-label, .card-footer-notice { letter-spacing: 0; overflow-wrap: anywhere; }
  .captcha-input-wrap .form-input::placeholder { font-size: 12px; letter-spacing: 0; }
  .submit-btn { min-height: 48px; letter-spacing: 0; }
}
