/* ==========================================================================
   ELM-O-SANAT EXECUTIVE AUTHENTICATION & SECURITY TRANSITION MODAL
   ========================================================================== */

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(2, 5, 11, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease-maybach), visibility 0.35s var(--ease-maybach);
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal-card {
  width: 100%;
  max-width: 470px;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(155deg, rgba(12, 23, 43, 0.97) 0%, rgba(4, 8, 16, 0.99) 100%);
  border: 1px solid var(--hairline-gold-active);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow:
    inset 0 1px 0 rgba(251, 243, 222, 0.12),
    0 28px 80px rgba(0, 0, 0, 0.92),
    0 0 40px rgba(212, 166, 68, 0.14);
  position: relative;
  transform: translate3d(0, 18px, 0) scale(0.97);
  transition: transform 0.38s var(--ease-maybach);
  text-align: right;
}

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

.modal-close-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline-gold);
  color: var(--text-muted);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--gold-100);
  border-color: var(--hairline-gold-active);
}

.modal-header-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold-300);
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.modal-header-title {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--text-pure-white);
  margin-bottom: 6px;
}

.modal-header-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-tabs-row {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
  gap: 20px;
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 4px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.auth-tab-btn.active {
  color: var(--gold-200);
}

.auth-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-gold);
}

.auth-input-group {
  margin-bottom: 14px;
}

.auth-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-platinum);
  margin-bottom: 6px;
}

.auth-input,
.auth-select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(2, 5, 11, 0.86);
  border: 1px solid var(--hairline-gold);
  border-radius: 12px;
  color: var(--text-pure-white);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-select option {
  background: #050a14;
  color: #ffffff;
}

.auth-input:focus,
.auth-select:focus {
  border-color: var(--hairline-gold-active);
  box-shadow: 0 0 16px rgba(212, 166, 68, 0.18);
}

.auth-role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.auth-role-chip {
  position: relative;
}

.auth-role-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-role-label {
  display: block;
  padding: 9px 10px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(2, 5, 11, 0.72);
  border: 1px solid rgba(227, 193, 110, 0.16);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.auth-role-chip input:checked + .auth-role-label {
  border-color: var(--hairline-gold-active);
  background: rgba(212, 166, 68, 0.16);
  color: var(--gold-100);
}

.auth-submit-btn {
  width: 100%;
  padding: 13px;
  background: var(--gradient-gold);
  color: #03070f;
  font-family: var(--font-main);
  font-size: 0.94rem;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 8px 24px rgba(212, 166, 68, 0.28);
  transition: transform 0.25s var(--ease-maybach), box-shadow 0.25s var(--ease-maybach);
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(212, 166, 68, 0.42);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-note {
  font-size: 0.76rem;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}

/* Choreographed Security Verification Stage (Replaces Abrupt Instant Login) */
.auth-transition-stage {
  display: none;
  padding: 16px 4px 6px;
  text-align: center;
  animation: fadeIn 0.35s var(--ease-maybach);
}

.auth-transition-stage.active {
  display: block;
}

.auth-shield-ring {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid var(--hairline-gold-active);
  background: radial-gradient(circle, rgba(212, 166, 68, 0.16) 0%, rgba(5, 10, 20, 0.9) 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-200);
  position: relative;
}

.auth-shield-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(242, 223, 168, 0.4);
  animation: haloSpin 10s linear infinite;
}

.auth-stage-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0 20px;
  text-align: right;
}

.auth-stage-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(2, 5, 11, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  color: var(--text-subtle);
  transition: all 0.3s ease;
}

.auth-stage-step.done {
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--text-platinum);
}

.auth-stage-step.done .step-badge {
  color: var(--status-success);
}

.auth-stage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-stage-actions a,
.auth-stage-actions button {
  flex: 1;
  min-width: 140px;
  padding: 11px 16px;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.auth-btn-portal {
  background: var(--gradient-gold);
  color: #03070f;
  border: none;
}

.auth-btn-continue {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline-gold);
  color: var(--text-platinum);
}

/* Mobile OTP & Mode Switch */
.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: rgba(2, 5, 11, 0.85);
  border: 1px solid var(--hairline-gold);
  border-radius: 12px;
  margin-bottom: 16px;
}

.auth-mode-btn {
  padding: 8px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-mode-btn.active {
  background: rgba(212, 166, 68, 0.16);
  color: var(--gold-100);
}

.auth-otp-box {
  padding: 16px;
  border-radius: 14px;
  background: rgba(2, 5, 11, 0.82);
  border: 1px solid var(--hairline-gold-active);
  margin-top: 10px;
}

.auth-otp-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.auth-otp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.auth-link-btn {
  background: transparent;
  border: none;
  color: var(--gold-200);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.auth-link-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-sandbox-hint {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(212, 166, 68, 0.1);
  border: 1px solid rgba(227, 193, 110, 0.25);
  color: var(--gold-100);
  font-size: 0.78rem;
  line-height: 1.6;
}

