/* static/css/auth_modal.css
   Ver.1268 - Black Theme Modern Auth Modal
   Scope: shared login/join modal only.  Existing form ids, field names,
   data-auth-* hooks, preverify flow, and auth_modal.js contracts are preserved.
*/

:root {
  --auth-modern-cyan: #22d3ee;
  --auth-modern-sky: #0ea5e9;
  --auth-modern-focus: rgba(103, 232, 249, 0.22);
}

.auth-modal {
  z-index: 1200;
}

.auth-modal.is-open {
  display: block;
}

.auth-modal-backdrop {
  background:
    radial-gradient(circle at 50% 18%, rgba(34, 211, 238, 0.13), transparent 34%),
    radial-gradient(circle at 8% 92%, rgba(99, 102, 241, 0.12), transparent 35%),
    rgba(2, 3, 7, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
  backdrop-filter: blur(16px) saturate(1.18);
}

.auth-modal-panel {
  --auth-panel: rgba(12, 12, 17, 0.985);
  --auth-panel-2: rgba(18, 18, 25, 0.98);
  --auth-line: rgba(255, 255, 255, 0.075);
  --auth-line-strong: rgba(255, 255, 255, 0.13);
  --auth-text: #f8fafc;
  --auth-muted: rgba(226, 232, 240, 0.72);
  --auth-input: rgba(9, 11, 17, 0.96);
  --auth-input-2: rgba(30, 30, 38, 0.86);
  --auth-focus: var(--auth-modern-focus);

  width: min(440px, calc(100vw - 28px));
  margin: clamp(18px, 5vh, 58px) auto;
  border-radius: 24px;
  color: var(--auth-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 24%),
    linear-gradient(180deg, var(--auth-panel-2), var(--auth-panel));
  border: 1px solid var(--auth-line);
  box-shadow:
    0 34px 80px -18px rgba(0, 0, 0, 0.82),
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  -webkit-backdrop-filter: blur(28px) saturate(1.1);
  backdrop-filter: blur(28px) saturate(1.1);
  overflow: hidden;
}

.auth-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.84), rgba(14, 165, 233, 0.7), transparent);
  pointer-events: none;
}

.auth-modal-header {
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.auth-modal-heading {
  gap: 7px;
}

.auth-modal-title {
  font-size: 1.34rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: #ffffff;
}

.auth-modal-subtitle {
  max-width: 31em;
  color: rgba(226, 232, 240, 0.66);
  font-size: 0.84rem;
}

.auth-modal-close {
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(248, 250, 252, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.auth-modal-close:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.46);
  background: rgba(255, 255, 255, 0.105);
  color: #ffffff;
}

.auth-modal-close:active {
  transform: translateY(0) scale(0.98);
}

.auth-modal-close:focus-visible,
.auth-preverify-btn:focus-visible,
.auth-modal-footer .auth-btn:focus-visible,
.auth-input:focus-visible,
.auth-textarea:focus-visible {
  outline: none;
  border-color: rgba(103, 232, 249, 0.78);
  box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.16), 0 0 22px rgba(34, 211, 238, 0.13);
}

.auth-modal-body {
  padding: 22px 24px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.38) transparent;
}

.auth-modal-body::-webkit-scrollbar {
  width: 7px;
}

.auth-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.33);
  border-radius: 999px;
}

.auth-form {
  gap: 13px;
}

.auth-label {
  display: block;
  margin: 5px 0 -4px;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.auth-label.is-focused {
  color: #67e8f9;
}

.auth-label-optional {
  color: rgba(203, 213, 225, 0.52);
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-input,
.auth-textarea {
  min-height: 52px;
  width: 100%;
  border: 1.5px solid rgba(255, 255, 255, 0.105);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(36, 38, 48, 0.82), rgba(14, 17, 24, 0.94));
  color: #f8fafc;
  font-size: 1.02rem;
  padding: 14px 16px;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.auth-input:hover,
.auth-textarea:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(42, 44, 55, 0.88), rgba(16, 19, 27, 0.96));
}

.auth-input:focus,
.auth-textarea:focus {
  border-color: rgba(103, 232, 249, 0.74);
  background:
    linear-gradient(180deg, rgba(40, 44, 55, 0.96), rgba(15, 19, 27, 0.98));
  box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.14), 0 16px 34px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.auth-input::placeholder,
.auth-textarea::placeholder {
  color: rgba(203, 213, 225, 0.42);
}

.auth-textarea {
  min-height: 92px;
  resize: vertical;
}

.auth-row {
  gap: 10px;
}

.auth-preverify-btn {
  flex-basis: 72px;
  min-width: 72px;
  height: 52px;
  border-radius: 15px;
  border: 1.5px solid rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(226, 232, 240, 0.94);
  font-weight: 900;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.auth-preverify-btn:hover:not([disabled]) {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.58);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.auth-preverify-btn:active:not([disabled]) {
  transform: translateY(0) scale(0.99);
}

.auth-preverify-btn.is-done {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.16);
  color: #dcfce7;
}

.auth-toast,
.auth-inline-error,
.auth-pane .gate-hint {
  border-radius: 14px;
}

.auth-toast {
  border-color: rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.105);
  color: #e0fbff;
}

.auth-inline-error {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

.auth-pane .gate-hint {
  color: rgba(203, 213, 225, 0.65);
}

.auth-modal-footer {
  gap: 12px;
  padding: 17px 24px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(12, 12, 17, 0.82), rgba(12, 12, 17, 0.985));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.auth-modal-footer .auth-btn {
  min-height: 50px;
  border-radius: 15px;
  font-size: 1rem;
  font-weight: 900;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.auth-modal-footer .auth-btn--primary {
  color: #031116;
  border: 0;
  background: linear-gradient(90deg, var(--auth-modern-cyan), var(--auth-modern-sky));
  box-shadow: 0 15px 30px -12px rgba(34, 211, 238, 0.58);
}

.auth-modal-footer .auth-btn--primary:hover:not([disabled]) {
  transform: translateY(-3px);
  box-shadow: 0 20px 34px -14px rgba(34, 211, 238, 0.72);
}

.auth-modal-footer .auth-btn--primary:active:not([disabled]) {
  transform: translateY(0) scale(0.99);
}

.auth-modal-footer .auth-btn--ghost {
  border: 1.5px solid rgba(148, 163, 184, 0.36);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(226, 232, 240, 0.92);
}

.auth-modal-footer .auth-btn--ghost:hover:not([disabled]) {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.58);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.auth-modal-footer .auth-btn[disabled],
.auth-modal-footer .auth-btn.is-disabled,
.auth-preverify-btn[disabled] {
  transform: none;
  filter: saturate(0.84);
}

.auth-modal-footer .auth-btn--primary[disabled],
.auth-modal-footer .auth-btn--primary.is-disabled {
  color: rgba(3, 17, 22, 0.78);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.54), rgba(14, 165, 233, 0.5));
  box-shadow: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .auth-modal-backdrop {
    background: rgba(2, 3, 7, 0.88);
  }
  .auth-modal-panel,
  .auth-modal-footer {
    background: #0c0c11;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal *,
  .auth-modal *::before,
  .auth-modal *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .auth-input:focus,
  .auth-textarea:focus,
  .auth-preverify-btn:hover:not([disabled]),
  .auth-modal-footer .auth-btn:hover:not([disabled]),
  .auth-modal-close:hover {
    transform: none;
  }
}

@media (max-width: 640px) {
  .auth-modal-panel {
    width: min(100vw - 18px, 430px);
    margin: max(10px, env(safe-area-inset-top)) auto 10px;
    max-height: calc(100dvh - 20px);
    border-radius: 22px;
  }
  .auth-modal-header {
    padding: 19px 18px 14px;
  }
  .auth-modal-title {
    font-size: 1.18rem;
  }
  .auth-modal-subtitle {
    font-size: 0.78rem;
  }
  .auth-modal-body {
    padding: 18px 16px 14px;
  }
  .auth-form {
    gap: 11px;
  }
  .auth-row--email {
    align-items: stretch;
  }
  .auth-preverify-btn {
    height: 52px;
    min-width: 68px;
    flex-basis: 68px;
  }
  .auth-modal-footer {
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .auth-modal-footer .auth-btn {
    min-height: 52px;
    padding-inline: 14px;
  }
}

@media (max-width: 360px) {
  .auth-row--email {
    flex-direction: column;
  }
  .auth-preverify-btn {
    width: 100%;
    flex-basis: auto;
  }
  .auth-modal-footer {
    flex-direction: column;
  }
  .auth-footer-switch {
    width: 100%;
  }
}

/* Ver.1319 - signup verification screenshot */
.auth-verification-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
}
.auth-required {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .18);
  color: #fecaca;
  font-size: 11px;
  font-weight: 900;
}
.auth-input--file {
  padding: 10px;
  cursor: pointer;
}
.auth-input--file::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(96, 165, 250, .36);
  border-radius: 10px;
  background: rgba(37, 99, 235, .9);
  color: #fff;
  font-weight: 900;
  padding: 8px 12px;
  cursor: pointer;
}
.auth-verification-help {
  margin-top: 8px;
  line-height: 1.5;
  color: #cbd5e1;
}

/* Ver.1320 - login adult verification is an optional existing-member request. */
.auth-verification-card--login{
  border-color: rgba(34,211,238,.34);
  background: linear-gradient(180deg, rgba(8,13,24,.72), rgba(15,23,42,.64));
}
.auth-verification-card--login .auth-label-optional{
  color:#67e8f9;
  font-weight:900;
}

/* Ver.1323 - login membership status by typed ID */
.auth-login-member-state[hidden],
.auth-verification-card--login[hidden] {
  display: none !important;
}
.auth-login-member-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 14px;
  background: rgba(15, 23, 42, .62);
  color: rgba(226, 232, 240, .92);
  line-height: 1.45;
}
.auth-login-member-state__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .16);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.auth-login-member-state__message {
  min-width: 0;
  color: rgba(203, 213, 225, .82);
  font-size: 13px;
}
.auth-login-member-state[data-state="general"] {
  border-color: rgba(34, 211, 238, .34);
  background: rgba(8, 13, 24, .72);
}
.auth-login-member-state[data-state="general"] .auth-login-member-state__badge {
  background: rgba(34, 211, 238, .16);
  color: #a5f3fc;
}
.auth-login-member-state[data-state="adult"] {
  border-color: rgba(34, 197, 94, .34);
  background: rgba(5, 46, 22, .24);
}
.auth-login-member-state[data-state="adult"] .auth-login-member-state__badge {
  background: rgba(34, 197, 94, .18);
  color: #bbf7d0;
}
.auth-login-member-state[data-state="inactive"],
.auth-login-member-state[data-state="unknown"],
.auth-login-member-state[data-state="error"] {
  border-color: rgba(248, 113, 113, .32);
  background: rgba(69, 10, 10, .22);
}
.auth-login-member-state[data-state="inactive"] .auth-login-member-state__badge,
.auth-login-member-state[data-state="unknown"] .auth-login-member-state__badge,
.auth-login-member-state[data-state="error"] .auth-login-member-state__badge {
  background: rgba(248, 113, 113, .18);
  color: #fecaca;
}
.auth-login-member-state[data-state="checking"] {
  border-color: rgba(148, 163, 184, .28);
  background: rgba(15, 23, 42, .46);
}

@media (max-width: 420px) {
  .auth-login-member-state {
    flex-direction: column;
    gap: 7px;
  }
  .auth-login-member-state__badge {
    min-width: 0;
  }
}
