/* ==========================================================================
   MOON CLIENT — account pages (login, register, 2FA, verify, password reset,
   terms agreement, launcher authorization). One centred glass card with the
   moon emblem; form controls come from moon.css.
   ========================================================================== */

.moon-auth { display: flex; flex-direction: column; min-height: 100vh; }

.auth-main {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2.5rem, 7vh, 5rem) 1rem clamp(3rem, 8vh, 6rem);
    box-sizing: border-box;
}

/* soft moonlight behind the card */
.auth-main::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 46%;
    width: min(760px, 120vw);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(closest-side, rgba(var(--moon-accent-rgb), 0.1), transparent 70%),
        radial-gradient(closest-side at 30% 30%, rgba(var(--moon-deep-rgb), 0.35), transparent 75%);
    pointer-events: none;
    z-index: -1;
}

.auth-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: clamp(1.75rem, 5vw, 2.6rem);
    box-sizing: border-box;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background:
        radial-gradient(120% 45% at 50% -6%, rgba(var(--moon-accent-rgb), 0.1), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)),
        rgba(var(--moon-panel-rgb), 0.55);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 40px 110px -30px rgba(0, 0, 0, 0.85), 0 0 70px -30px rgba(var(--moon-accent-rgb), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* thin light along the top edge, like the navigation */
.auth-panel::before {
    content: '';
    position: absolute;
    left: 18%;
    right: 18%;
    top: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--moon-accent-hi), transparent);
    opacity: 0.8;
}

.auth-panel--wide { max-width: 640px; }

/* head: emblem, eyebrow, title, lead */
.auth-head { text-align: center; margin-bottom: 1.8rem; }

.auth-emblem {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 1.1rem;
    box-sizing: border-box;
    border-radius: 20px;
    border: 1px solid var(--moon-line-2);
    background: linear-gradient(160deg, rgba(var(--moon-accent-rgb), 0.16), rgba(var(--moon-accent-rgb), 0.03));
    box-shadow: 0 14px 40px -14px rgba(var(--moon-accent-rgb), 0.55), inset 0 1px rgba(255, 255, 255, 0.1);
    color: var(--moon-accent-hi);
}

.auth-emblem img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.auth-emblem svg { width: 28px; height: 28px; }

.auth-emblem--ok { color: var(--moon-ok); border-color: rgba(61, 220, 151, 0.35); background: rgba(61, 220, 151, 0.08); box-shadow: 0 14px 40px -14px rgba(61, 220, 151, 0.5); }
.auth-emblem--danger { color: #ff8a96; border-color: rgba(255, 92, 108, 0.35); background: rgba(255, 92, 108, 0.08); box-shadow: 0 14px 40px -14px rgba(255, 92, 108, 0.5); }

.auth-head .moon-eyebrow { display: flex; justify-content: center; margin: 0 0 0.7rem; }

.auth-title {
    margin: 0;
    font-family: var(--moon-font-display);
    font-size: clamp(1.6rem, 4.5vw, 2.05rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #fff;
}

.auth-lead { margin: 0.7rem auto 0; max-width: 360px; color: var(--moon-dim); font-size: 0.93rem; line-height: 1.6; }
.auth-lead strong { color: #fff; font-weight: 600; word-break: break-all; }

.auth-panel .alert { margin: 0 0 1.2rem; padding: 0.8rem 1rem; font-size: 0.88rem; }

/* form */
.auth-form { display: flex; flex-direction: column; gap: 1.05rem; margin: 0; }

.auth-field { display: flex; flex-direction: column; gap: 0.45rem; margin: 0; }
.auth-field > label,
.auth-label {
    margin: 0;
    color: var(--moon-dim);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-field input { width: 100%; margin: 0; height: 48px; border-radius: 13px; box-sizing: border-box; }

.auth-hint { display: block; min-height: 0; color: #ff8a96; font-size: 0.78rem; font-weight: 600; }
.auth-hint:empty { display: none; }

.auth-strength { margin-top: 0.15rem; }
.auth-strength-track { height: 4px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.auth-strength-track > div { height: 100%; width: 0; border-radius: inherit; transition: width 0.3s ease, background-color 0.3s ease; }
.auth-strength small { display: block; margin-top: 0.35rem; font-size: 0.76rem; font-weight: 700; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.auth-check { display: inline-flex; align-items: center; gap: 0.55rem; margin: 0; color: var(--moon-dim); font-size: 0.88rem; font-weight: 500; cursor: pointer; }
.auth-check input { width: 17px; height: 17px; margin: 0; cursor: pointer; }
.auth-check--center { align-self: center; }

.auth-captcha { display: flex; justify-content: center; }
.auth-captcha altcha-widget { width: 100%; }

.auth-submit { width: 100%; height: 50px; margin-top: 0.3rem; border-radius: 14px; font-size: 0.97rem; }

.auth-link {
    color: var(--moon-accent-hi);
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s var(--moon-ease), color 0.2s ease;
}

.auth-link:hover { background-size: 100% 1px; color: #fff; }

button.auth-link { padding: 0; border: 0; background-color: transparent; font: inherit; font-weight: 600; cursor: pointer; }
button.auth-link:disabled { color: var(--moon-mute); cursor: not-allowed; background-size: 0 1px; }
.auth-link--muted { color: var(--moon-dim); }

/* "or continue with" */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.8rem 0 1.1rem;
    color: var(--moon-mute);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--moon-line), transparent); }

.auth-socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.65rem; }

.auth-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    height: 46px;
    padding: 0 1rem;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--moon-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s var(--moon-ease), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.auth-social img { width: 19px; height: 19px; object-fit: contain; filter: brightness(0) invert(1); }
.auth-social img.auth-social-logo { border-radius: 5px; filter: none; object-fit: cover; }

.auth-social:hover {
    transform: translateY(-2px);
    color: #fff;
    border-color: rgba(var(--moon-accent-rgb), 0.4);
    background: rgba(var(--moon-accent-rgb), 0.07);
    box-shadow: 0 12px 28px -14px rgba(var(--moon-accent-rgb), 0.6);
}

.auth-social--discord:hover { border-color: rgba(88, 101, 242, 0.6); background: rgba(88, 101, 242, 0.16); box-shadow: 0 12px 28px -14px rgba(88, 101, 242, 0.8); }

.auth-foot { margin: 1.7rem 0 0; text-align: center; color: var(--moon-dim); font-size: 0.9rem; }

.auth-section {
    margin-top: 1.6rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--moon-line);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.auth-section p { margin: 0 0 0.35rem; color: var(--moon-mute); font-size: 0.84rem; }

/* one-time codes */
.auth-code {
    width: 100%;
    height: 74px !important;
    margin: 0;
    box-sizing: border-box;
    border-radius: 18px !important;
    text-align: center;
    font-family: var(--moon-font-mono);
    font-size: 2.1rem !important;
    font-weight: 600;
    letter-spacing: 0.5em;
    padding-left: 0.5em !important;
    color: #fff;
}

.auth-code::placeholder { color: rgba(255, 255, 255, 0.14); }

/* choice buttons (2FA method) */
.auth-choices { display: flex; flex-direction: column; gap: 0.7rem; }
.auth-choices form { margin: 0; }

.auth-choice {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--moon-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.25s var(--moon-ease), border-color 0.25s ease, background 0.25s ease;
}

.auth-choice:hover { transform: translateY(-2px); border-color: rgba(var(--moon-accent-rgb), 0.4); background: rgba(var(--moon-accent-rgb), 0.07); }

.auth-choice-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    border: 1px solid var(--moon-line-2);
    background: rgba(var(--moon-accent-rgb), 0.08);
    color: var(--moon-accent-hi);
}

.auth-choice-icon svg { width: 20px; height: 20px; }
.auth-choice strong { display: block; color: #fff; font-size: 0.95rem; }
.auth-choice small { display: block; margin-top: 0.15rem; color: var(--moon-dim); font-size: 0.8rem; }
.auth-choice-arrow { margin-left: auto; color: var(--moon-mute); }
.auth-choice-arrow svg { width: 18px; height: 18px; }

/* inline sub-form (change e-mail) */
.auth-subform {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.1rem;
    border-radius: 16px;
    border: 1px solid var(--moon-line);
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
}

.auth-subform[hidden] { display: none; }
.auth-subform .auth-actions { display: flex; gap: 0.6rem; }
.auth-subform .auth-actions .btn { flex: 1; }

/* terms agreement */
.auth-terms {
    margin: 0 0 1.6rem;
    padding: 1.3rem 1.4rem;
    border-radius: 18px;
    border: 1px solid var(--moon-line);
    background: rgba(255, 255, 255, 0.025);
    max-height: 360px;
    overflow-y: auto;
}

.auth-terms h2 { margin: 0 0 0.9rem; font-family: var(--moon-font-display); font-size: 1rem; color: #fff; }
.auth-terms ul { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.auth-terms li { display: flex; gap: 0.75rem; color: var(--moon-dim); font-size: 0.9rem; line-height: 1.55; }
.auth-terms li svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 0.15rem; color: var(--moon-accent-hi); }
.auth-terms li strong { color: #fff; }
.auth-terms p { margin: 0; text-align: center; font-size: 0.86rem; color: var(--moon-dim); }

.auth-note { margin: 0; text-align: center; color: var(--moon-mute); font-size: 0.84rem; line-height: 1.55; }

.auth-danger-link { padding: 0; border: 0; background: none; color: #ff8a96; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-danger-link:hover { color: #ffb3bb; }

/* launcher authorization */
.auth-device-code {
    margin: 0 0 1.3rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px dashed var(--moon-line-2);
    background: rgba(var(--moon-accent-rgb), 0.05);
    text-align: center;
    font-family: var(--moon-font-mono);
    font-size: clamp(1.5rem, 6vw, 2rem);
    font-weight: 600;
    letter-spacing: 0.22em;
    color: #fff;
}

.auth-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0 0 1.6rem; }
.auth-facts div { padding: 0.8rem 0.6rem; border-radius: 14px; border: 1px solid var(--moon-line); background: rgba(255, 255, 255, 0.025); text-align: center; }
.auth-facts dt { margin: 0 0 0.3rem; color: var(--moon-mute); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.auth-facts dd { margin: 0; color: #fff; font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }

.auth-actions { display: flex; gap: 0.7rem; }
.auth-actions .btn { flex: 1; height: 48px; border-radius: 13px; }

.auth-mono { font-family: var(--moon-font-mono); color: var(--moon-mute); text-align: center; margin: 1.3rem 0 0; font-size: 0.85rem; letter-spacing: 0.12em; }

@media (max-width: 520px) {
    .auth-panel { border-radius: 22px; }
    .auth-facts { grid-template-columns: 1fr; }
    .auth-code { font-size: 1.7rem !important; letter-spacing: 0.4em; }
}
