:root {
  --auth-base: #051d44;
  --auth-base-soft: #0a275a;
  --auth-accent: #d6bc73;
  --auth-accent-hover: #c4a95d;
  --auth-white: #ffffff;
  --auth-text: #1b2330;
  --auth-muted: #64748b;
  --auth-border: #e2e8f0;
  --auth-input-bg: #f8fafc;
}

body.auth-body {
  min-height: 100vh;
  margin: 0;
  /* Deep premium background matching the logo */
  background: var(--auth-base);
  background: radial-gradient(circle at 50% 0%, #0c2f69 0%, #051d44 50%, #020b1c 100%);
  color: var(--auth-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-brand {
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand-header img {
  width: 100%;
  max-width: 320px;
  height: auto;
  /* Add a soft glow behind the logo so it pops out */
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.4));
}

.auth-panel-wrap {
  width: 100%;
  max-width: 440px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s backwards;
}

.auth-card {
  width: 100%;
  border: none;
  border-radius: 24px;
  background: var(--auth-white);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;
  overflow: hidden;
}

.auth-card .card-body {
  padding: 3rem 2.5rem;
}

.auth-title {
  color: var(--auth-base);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--auth-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.auth-accent-rule {
  height: 4px;
  width: 48px;
  border-radius: 4px;
  background: var(--auth-accent);
  margin-bottom: 1.5rem;
}

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

.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
}

.auth-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--auth-border);
  background: var(--auth-input-bg);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--auth-text);
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02) inset;
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-accent);
  background: var(--auth-white);
  box-shadow: 0 0 0 4px rgba(214, 188, 115, 0.15), 0 1px 2px rgba(0,0,0,0.02) inset;
}

.form-check {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  padding-left: 0; /* Override bootstrap */
}

.form-check-input {
  position: static; /* Override bootstrap absolute positioning */
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0;
  margin-left: 0; /* Override bootstrap */
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: var(--auth-base);
}

.form-check-label {
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
  color: var(--auth-muted);
}

.auth-action {
  width: 100%;
  padding: 0.875rem;
  border-radius: 12px;
  border: none;
  background: var(--auth-base);
  color: var(--auth-white);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.auth-action:hover,
.auth-action:focus {
  background: var(--auth-base-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(5, 29, 68, 0.3);
  color: var(--auth-white);
}

.auth-action:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(5, 29, 68, 0.3);
}

.auth-action::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(214, 188, 115, 0.45);
  pointer-events: none;
}

.auth-action.is-loading {
  cursor: wait;
}

.auth-action.is-loading::before {
  animation: authButtonLoading 1s linear forwards;
}

@keyframes authButtonLoading {
  from { width: 0; }
  to { width: 100%; }
}

.auth-link {
  color: var(--auth-base);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--auth-accent);
  text-decoration: underline;
}

.alert {
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  border: none;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
}

/* 2FA specifics */
.otp-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

#otp_code {
  text-align: center;
  font-size: 1.75rem;
  letter-spacing: 0.4em;
  font-weight: 700;
  padding-left: 0.8em; /* To visually center text with letter-spacing */
}

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

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

@media (max-width: 576px) {
  .auth-card .card-body {
    padding: 2rem 1.5rem;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
}
