/* ============================================================================
   ROB E BANK AI — auth.css
   Login page, access-denied page, and Terms modal styles.
   Must load BEFORE theme.css so that .auth-modal display:none fires before
   any JavaScript runs — this stops the Terms block rendering as visible text.
   ============================================================================ */


/* ─── BODY LOCK / UNLOCK STATES ────────────────────────────────────────────── */

body.auth-locked nav.nav,
body.auth-locked main.container {
  display: none !important;
}

body.auth-authorized #auth-login-page,
body.auth-authorized #auth-access-denied {
  display: none !important;
}


/* ─── AUTH MODAL — HIDDEN BY DEFAULT ───────────────────────────────────────── */
/* This is the most critical rule: keeps the Terms block invisible until
   auth.js calls openTermsModal() which adds .show                              */

.auth-modal {
  display:         none;          /* <-- hidden by default */
  position:        fixed;
  inset:           0;
  z-index:         9999;
  align-items:     center;
  justify-content: center;
  padding:         1rem;
  background:      rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.auth-modal.show {
  display: flex;                  /* revealed by auth.js */
}


/* ─── FULL-SCREEN AUTH PAGES ────────────────────────────────────────────────── */

.auth-page {
  min-height:      100vh;
  width:           100%;
  display:         flex;
  align-items:     flex-start;
  justify-content: center;
  padding:         2rem 1rem 3rem;
  background:      #050608;
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -8%, rgba(190, 130, 32, 0.20) 0%, transparent 68%),
    radial-gradient(ellipse 60% 40% at 15% 90%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 90% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 55%);
}


/* ─── AUTH CONTAINER ────────────────────────────────────────────────────────── */

.auth-container {
  width:     100%;
  max-width: 440px;
  display:   flex;
  flex-direction: column;
  gap:       1.5rem;
}


/* ─── BRAND HEADER ──────────────────────────────────────────────────────────── */

.auth-brand {
  text-align: center;
  padding:    0.5rem 0 0.25rem;
}

.auth-brand-title {
  font-size:   1.75rem;
  font-weight: 700;
  color:       #eaaa36;
  letter-spacing: -0.01em;
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         0.5rem;
  text-shadow: 0 0 24px rgba(210, 152, 48, 0.52),
               0 0 48px rgba(210, 152, 48, 0.20);
}

.auth-brand-icon {
  font-size: 1.6rem;
}

.auth-brand-sub {
  margin-top: 0.35rem;
  font-size:  0.78rem;
  color:      rgba(210, 170, 80, 0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}


/* ─── LOGIN CARD ────────────────────────────────────────────────────────────── */

.auth-card {
  background:    rgba(12, 16, 24, 0.90);
  border:        1px solid rgba(190, 138, 42, 0.34);
  border-radius: 1rem;
  padding:       1.75rem 1.5rem;
  box-shadow:
    0 0 28px rgba(190, 138, 42, 0.14),
    0 0 0 1px rgba(190, 138, 42, 0.08),
    0 8px 36px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(210, 152, 52, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-card-header {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  margin-bottom: 0.25rem;
}

.auth-card-header-icon {
  font-size: 1.15rem;
}

.auth-card-title {
  font-size:   1.05rem;
  font-weight: 700;
  color:       #f0e4c8;
}

.auth-card-sub {
  font-size:     0.78rem;
  color:         #64748b;
  margin-bottom: 1.25rem;
  line-height:   1.5;
}

.auth-card-foot {
  margin-top:  1.25rem;
  font-size:   0.72rem;
  color:       #475569;
  text-align:  center;
  line-height: 1.5;
}


/* ─── ERROR BANNER ──────────────────────────────────────────────────────────── */

.auth-error {
  display:       none;
  background:    rgba(239, 68, 68, 0.12);
  border:        1px solid rgba(239, 68, 68, 0.35);
  border-radius: 0.5rem;
  color:         #fca5a5;
  font-size:     0.8rem;
  padding:       0.6rem 0.85rem;
  margin-bottom: 1rem;
  line-height:   1.5;
}

.auth-error.show {
  display: block;
}


/* ─── FORM FIELDS ───────────────────────────────────────────────────────────── */

.auth-field {
  display:       flex;
  flex-direction: column;
  gap:           0.35rem;
  margin-bottom: 1rem;
}

.auth-field-label {
  font-size:   0.75rem;
  font-weight: 600;
  color:       #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-input {
  background:    rgba(255, 255, 255, 0.05);
  border:        1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color:         #e2e8f0;
  font-size:     0.9rem;
  padding:       0.65rem 0.85rem;
  outline:       none;
  transition:    border-color 0.2s, box-shadow 0.2s;
  width:         100%;
  box-sizing:    border-box;
}

.auth-input::placeholder {
  color: #475569;
}

.auth-input:focus {
  border-color: rgba(200, 148, 48, 0.58);
  box-shadow:   0 0 0 2px rgba(200, 148, 48, 0.14),
                0 0 10px rgba(200, 148, 48, 0.16);
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0f141e inset, 0 0 0 3px rgba(139, 92, 246, 0.12);
  -webkit-text-fill-color: #e2e8f0;
  caret-color: #e2e8f0;
}


/* ─── TERMS CHECKBOX ROW ────────────────────────────────────────────────────── */

.auth-terms-row {
  display:     flex;
  align-items: flex-start;
  gap:         0.6rem;
  margin-bottom: 1.25rem;
  cursor:      pointer;
}

.auth-checkbox {
  margin-top:   0.15rem;
  accent-color: #8b5cf6;
  width:        1rem;
  height:       1rem;
  flex-shrink:  0;
  cursor:       pointer;
}

.auth-terms-text {
  font-size:   0.8rem;
  color:       #94a3b8;
  line-height: 1.55;
}

.auth-terms-link {
  color:           #a78bfa;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition:      color 0.15s;
}

.auth-terms-link:hover {
  color: #c4b5fd;
}


/* ─── PRIMARY BUTTON ────────────────────────────────────────────────────────── */

.auth-btn-primary {
  width:         100%;
  padding:       0.75rem 1rem;
  background:    linear-gradient(135deg, #b8781e 0%, #d49228 50%, #e8a832 100%);
  border:        1px solid rgba(210, 152, 48, 0.55);
  border-radius: 0.65rem;
  color:         #0d0a03;
  font-size:     0.92rem;
  font-weight:   700;
  letter-spacing: 0.03em;
  cursor:        pointer;
  transition:    opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow:    0 4px 18px rgba(200, 148, 42, 0.38),
                 0 0 32px rgba(200, 148, 42, 0.14);
}

.auth-btn-primary:hover:not(:disabled) {
  opacity:    0.94;
  box-shadow: 0 6px 28px rgba(200, 148, 42, 0.58),
              0 0 50px rgba(200, 148, 42, 0.22);
}

.auth-btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-btn-primary:disabled {
  opacity: 0.36;
  cursor:  not-allowed;
  box-shadow: none;
}

.auth-biometric-panel {
  margin-top:     0.9rem;
  padding:        0.85rem;
  border:         1px solid rgba(45, 212, 191, 0.18);
  border-radius:  0.65rem;
  background:     rgba(15, 23, 42, 0.48);
  box-shadow:     inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-btn-secondary {
  width:         100%;
  padding:       0.68rem 0.9rem;
  background:    rgba(15, 23, 42, 0.88);
  border:        1px solid rgba(45, 212, 191, 0.35);
  border-radius: 0.6rem;
  color:         #99f6e4;
  font-size:     0.84rem;
  font-weight:   700;
  cursor:        pointer;
  transition:    border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.auth-btn-secondary:hover:not(:disabled) {
  border-color: rgba(45, 212, 191, 0.68);
  box-shadow:   0 0 20px rgba(20, 184, 166, 0.18);
}

.auth-btn-secondary:disabled {
  opacity: 0.38;
  cursor:  not-allowed;
}

.auth-biometric-enroll {
  display:     flex;
  align-items: flex-start;
  gap:         0.55rem;
  margin-top:  0.75rem;
  color:       #94a3b8;
  font-size:   0.76rem;
  line-height: 1.45;
}

.auth-biometric-enroll input:disabled + span {
  opacity: 0.5;
}

.auth-biometric-note {
  margin-top:   0.55rem;
  color:        #64748b;
  font-size:    0.7rem;
  line-height:  1.45;
}


/* ─── SOCIAL / COMMUNITY CARD ───────────────────────────────────────────────── */

.auth-social-card {
  background:    rgba(10, 14, 20, 0.82);
  border:        1px solid rgba(190, 138, 42, 0.20);
  border-radius: 1rem;
  padding:       1.25rem 1.5rem;
  text-align:    center;
  box-shadow:    0 4px 20px rgba(0, 0, 0, 0.50),
                 inset 0 1px 0 rgba(210, 152, 52, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-social-title {
  font-size:     0.9rem;
  font-weight:   700;
  color:         #cbd5e1;
  margin-bottom: 0.3rem;
}

.auth-social-sub {
  font-size:     0.75rem;
  color:         #64748b;
  margin-bottom: 1rem;
}

.auth-social-row {
  display:         flex;
  gap:             0.6rem;
  justify-content: center;
  flex-wrap:       wrap;
  margin-bottom:   0.75rem;
}

.auth-social-btn {
  display:         inline-flex;
  align-items:     center;
  gap:             0.35rem;
  padding:         0.45rem 0.85rem;
  border-radius:   0.5rem;
  font-size:       0.78rem;
  font-weight:     600;
  text-decoration: none;
  transition:      opacity 0.15s, transform 0.1s;
  border:          1px solid transparent;
}

.auth-social-btn:hover {
  opacity:   0.85;
  transform: translateY(-1px);
}

.auth-social-btn-whatsapp {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.35);
  color: #4ade80;
}

.auth-social-btn-telegram {
  background: rgba(38, 161, 222, 0.15);
  border-color: rgba(38, 161, 222, 0.35);
  color: #38bdf8;
}

.auth-social-btn-instagram {
  background: rgba(225, 48, 108, 0.12);
  border-color: rgba(225, 48, 108, 0.3);
  color: #fb7185;
}

.auth-social-group-btn {
  display:         block;
  padding:         0.55rem 1rem;
  background:      rgba(38, 161, 222, 0.1);
  border:          1px solid rgba(38, 161, 222, 0.3);
  border-radius:   0.55rem;
  color:           #7dd3fc;
  font-size:       0.8rem;
  font-weight:     600;
  text-decoration: none;
  text-align:      center;
  transition:      background 0.15s, opacity 0.15s, transform 0.1s;
  margin-bottom:   0.85rem;
}

.auth-social-group-btn:hover {
  background: rgba(38, 161, 222, 0.18);
  opacity:    0.9;
  transform:  translateY(-1px);
}

.auth-social-foot {
  font-size:  0.72rem;
  color:      #475569;
  line-height: 1.5;
}


/* ─── ACCESS DENIED SCREEN ──────────────────────────────────────────────────── */

.auth-denied {
  background:    rgba(15, 20, 30, 0.85);
  border:        1px solid rgba(239, 68, 68, 0.25);
  border-radius: 1rem;
  padding:       2.5rem 1.5rem;
  text-align:    center;
  box-shadow:    0 8px 32px rgba(0, 0, 0, 0.55);
}

.auth-denied-icon {
  font-size:     3rem;
  margin-bottom: 0.75rem;
}

.auth-denied-title {
  font-size:     1.35rem;
  font-weight:   700;
  color:         #fca5a5;
  margin-bottom: 0.75rem;
}

.auth-denied-msg {
  font-size:     0.85rem;
  color:         #94a3b8;
  line-height:   1.65;
  margin-bottom: 1.75rem;
}

.auth-denied-back-btn {
  display:       inline-block;
  padding:       0.6rem 1.5rem;
  background:    rgba(239, 68, 68, 0.12);
  border:        1px solid rgba(239, 68, 68, 0.35);
  border-radius: 0.55rem;
  color:         #fca5a5;
  font-size:     0.85rem;
  font-weight:   600;
  cursor:        pointer;
  transition:    background 0.15s, transform 0.1s;
}

.auth-denied-back-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform:  translateY(-1px);
}


/* ─── TERMS MODAL CARD ──────────────────────────────────────────────────────── */

.auth-modal-card {
  background:    rgba(10, 14, 22, 0.97);
  border:        1px solid rgba(139, 92, 246, 0.3);
  border-radius: 1.1rem;
  padding:       2rem 1.75rem;
  width:         100%;
  max-width:     520px;
  max-height:    80vh;
  overflow-y:    auto;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.1),
    0 24px 64px rgba(0, 0, 0, 0.75);
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.35) transparent;
}

.auth-modal-card::-webkit-scrollbar {
  width: 5px;
}
.auth-modal-card::-webkit-scrollbar-track {
  background: transparent;
}
.auth-modal-card::-webkit-scrollbar-thumb {
  background-color: rgba(139, 92, 246, 0.35);
  border-radius: 10px;
}

.auth-modal-title {
  font-size:     1.1rem;
  font-weight:   700;
  color:         #e2e8f0;
  margin-bottom: 0.25rem;
}

.auth-modal-sub {
  font-size:     0.73rem;
  color:         #64748b;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.auth-modal-list {
  list-style:    none;
  padding:       0;
  margin:        0 0 1.5rem;
  display:       flex;
  flex-direction: column;
  gap:           0.75rem;
}

.auth-modal-list li {
  font-size:     0.82rem;
  color:         #cbd5e1;
  line-height:   1.65;
  padding-left:  1.2rem;
  position:      relative;
}

.auth-modal-list li::before {
  content:    '·';
  position:   absolute;
  left:       0;
  color:      #8b5cf6;
  font-size:  1.1rem;
  line-height: 1.4;
}

.auth-modal-foot {
  text-align: center;
}

.auth-modal-close-btn {
  display:       inline-block;
  padding:       0.65rem 2rem;
  background:    linear-gradient(135deg, #b8781e 0%, #d49228 50%, #e8a832 100%);
  border:        1px solid rgba(210, 152, 48, 0.55);
  border-radius: 0.65rem;
  color:         #0d0a03;
  font-size:     0.88rem;
  font-weight:   700;
  cursor:        pointer;
  transition:    opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow:    0 4px 18px rgba(200, 148, 42, 0.38);
}

.auth-modal-close-btn:hover {
  opacity:    0.90;
  transform:  translateY(-1px);
  box-shadow: 0 6px 26px rgba(200, 148, 42, 0.56);
}

.auth-modal-close-btn:active {
  transform: scale(0.97);
}


/* ─── RESPONSIVE ────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .auth-page {
    padding: 1rem 0.75rem 2rem;
  }

  .auth-card {
    padding: 1.25rem 1rem;
  }

  .auth-social-card {
    padding: 1rem;
  }

  .auth-social-row {
    gap: 0.5rem;
  }

  .auth-social-btn {
    font-size: 0.72rem;
    padding:   0.4rem 0.65rem;
  }

  .auth-modal-card {
    padding:   1.25rem 1rem;
    max-height: 85vh;
  }

  .auth-brand-title {
    font-size: 1.4rem;
  }
}
