/* ==========================================================================
   Forex Binary — Auth pages (login / register / forgot password / success)
   Shares the "Onyx Gold Noir" design tokens from style.css.
   ========================================================================== */

.auth-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.25rem 2.5rem;
}

.auth-shell-tight { padding-top: 1rem; padding-bottom: 1rem; }
.auth-shell-tight .auth-card {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.auth-shell-tight .auth-logo-img { max-height: 52px; }
.auth-shell-tight .auth-icon-badge { width: 36px; height: 36px; }
.auth-shell-tight .cred-row { padding: 0.5rem 0.9rem; }
.auth-shell-tight .cred-row + .cred-row { margin-top: 0.4rem; }
.auth-shell-tight .cred-value { font-size: 0.95rem; }

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 2.1rem 2rem;
  border-radius: 0.5rem;
}

.auth-card.auth-card-wide {
  max-width: 620px;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(260px, 82vw);
  margin-inline: auto;
}

.auth-logo-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,0.55)) drop-shadow(0 0 14px rgba(212,175,55,0.18));
}

.auth-logo-wrap { width: 44px; height: 44px; }

.auth-logo-text {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  margin-right: -0.16em;
  color: #f7f5f0;
}

.auth-icon-badge {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-inline: auto;
  background: linear-gradient(145deg, rgba(212,175,55,0.16), rgba(42,77,255,0.12));
  border: 1px solid rgba(212,175,55,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 18px 36px -20px rgba(212,175,55,0.75);
}

.auth-field { margin-bottom: 1.05rem; }

.auth-label {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver, #b8b8bf);
  margin-bottom: 0.55rem;
}

.auth-input-wrap { position: relative; }

.auth-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 0.35rem;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  color: #f7f5f0;
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.auth-input::placeholder { color: rgba(184, 184, 191, 0.55); }

.auth-input:focus {
  outline: none;
  border-color: var(--gold, #d4af37);
  background: rgba(212, 175, 55, 0.06);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.auth-input.has-error { border-color: rgba(248, 113, 113, 0.6); }
.auth-input.has-success { border-color: rgba(74, 222, 128, 0.55); }

.auth-input-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold, #d4af37);
  pointer-events: none;
}

/* Mobile number field — intl-tel-input flag/dial-code picker */
.iti { width: 100%; }
.auth-phone-input.iti__tel-input { width: 100%; }

.iti__selected-flag {
  background: transparent !important;
  border-right: 1px solid rgba(212, 175, 55, 0.25);
}
.iti__selected-flag:hover,
.iti__selected-flag:focus { background: rgba(212, 175, 55, 0.08) !important; }

.iti__country-list {
  background: #121212;
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #f7f5f0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  left: 0;
  width: max-content;
  min-width: 100%;
  max-width: min(320px, calc(100vw - 2.5rem));
  white-space: normal;
}
.iti__country { color: #f7f5f0; }
.iti__country.iti__highlight { background-color: rgba(212, 175, 55, 0.15); }
.iti__divider { border-bottom-color: rgba(212, 175, 55, 0.2); }

@media (max-width: 480px) {
  .iti__country-list {
    max-width: calc(100vw - 2rem);
  }
}
.iti__dial-code { color: rgba(184, 184, 191, 0.85); }

.auth-toggle-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--silver, #b8b8bf);
  background: none;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0.25rem;
}
.auth-toggle-btn:hover { color: var(--gold, #d4af37); }

.auth-hint {
  font-size: 0.74rem;
  margin-top: 0.45rem;
  min-height: 1em;
  font-family: "Inter", sans-serif;
  transition: color 0.2s ease;
}
.auth-hint.is-valid { color: #86efac; }
.auth-hint.is-invalid { color: #fca5a5; }
.auth-hint.is-pending { color: rgba(184, 184, 191, 0.75); }

.auth-chip-group { display: flex; gap: 0.75rem; }

.auth-chip {
  flex: 1;
  text-align: center;
  padding: 0.7rem 0.75rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(255, 255, 255, 0.02);
  color: var(--silver, #b8b8bf);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.auth-chip:hover { border-color: rgba(212, 175, 55, 0.45); }

.auth-chip-input:checked + .auth-chip {
  border-color: var(--gold, #d4af37);
  color: var(--gold-light, #f2d488);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.auth-submit {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 0.35rem;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.auth-submit[disabled] { opacity: 0.7; cursor: progress; }

.auth-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(6, 6, 6, 0.35);
  border-top-color: rgba(6, 6, 6, 0.9);
  animation: authSpin 0.7s linear infinite;
  display: none;
}
.auth-submit[disabled] .auth-spinner { display: inline-block; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-divider-text {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: rgba(184, 184, 191, 0.5);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 1.15rem 0 0.9rem;
}
.auth-divider-text::before,
.auth-divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
}

.auth-footnote {
  text-align: center;
  font-size: 0.85rem;
  color: var(--silver, #b8b8bf);
  font-family: "Inter", sans-serif;
}
.auth-footnote a { color: var(--gold-light, #f2d488); font-weight: 600; }
.auth-footnote a:hover { text-decoration: underline; }

.auth-back-home {
  position: fixed;
  top: 1.75rem;
  left: 1.75rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--silver, #b8b8bf);
}
.auth-back-home:hover { color: var(--gold, #d4af37); }

.auth-back-logo-img {
  display: block;
  width: min(210px, 58vw);
  height: auto;
  max-height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(0,0,0,0.55)) drop-shadow(0 0 12px rgba(212,175,55,0.2));
}

/* ---------------- Legacy ajax-response message box ----------------
   ajaxpages/*.php return raw Bootstrap-flavoured HTML fragments
   (.alert/.alert-danger/.alert-success/.btn/.btn-warning). This shims
   those class names to the Onyx Gold Noir palette without touching the
   PHP endpoints themselves. */

.auth-msg-box:empty { display: none; }
.auth-msg-box { margin-top: 1.35rem; }

.auth-msg-box .alert,
.auth-msg-box .btn {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.35rem;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid transparent;
  text-align: center;
}

.auth-msg-box .alert-danger,
.auth-msg-box .btn-warning,
.auth-msg-box .btn-danger {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.auth-msg-box .alert-success,
.auth-msg-box .btn-success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.4);
  color: #86efac;
}

.auth-msg-box strong { color: inherit; }

/* Credential card on success.php */
.cred-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(212, 175, 55, 0.2);
}
.cred-row + .cred-row { margin-top: 0.65rem; }
.cred-label {
  flex: 0 0 108px;
  font-size: 0.68rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--silver, #b8b8bf);
}
.cred-value {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light, #f2d488);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

/* User ID gets its own monospace "code" treatment so it reads unambiguously
   (no l/1 or O/0 confusion) and stands apart from the password rows. */
.cred-value-id {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 0.3rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

@media (max-width: 480px) {
  .cred-row { flex-wrap: wrap; }
  .cred-label { flex: 1 1 100%; margin-bottom: 0.2rem; }
}

.cred-copy-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 0.35rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light, #f2d488);
  cursor: pointer;
  transition: all 0.2s ease;
}
.cred-copy-btn:hover { background: rgba(212, 175, 55, 0.16); border-color: var(--gold, #d4af37); }
.cred-copy-btn.is-copied {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.55);
  color: #86efac;
}

.inline-icon { display: inline-block; vertical-align: -1px; color: var(--gold, #d4af37); }

/* Falling confetti / flower petals on success.php */
#successConfettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 480px) {
  .auth-card { padding: 1.65rem 1.25rem; }
  .auth-back-home { top: 1.1rem; left: 1.1rem; }
  .auth-logo { width: min(230px, 78vw); }
  .auth-back-logo-img { width: min(174px, 58vw); }
}

.reveal-in { animation: authRevealIn 0.7s ease both; }
@keyframes authRevealIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-in { animation: none; }
}
