/* Shared login and signup entry panels. Other account pages keep their layout. */
@font-face {
    font-family: "WhaleMath Login";
    src: url("../../fonts/SpoqaHanSansNeo_WOFF2_Subset/SpoqaHanSansNeo-Regular.6f876d098a68.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "WhaleMath Login";
    src: url("../../fonts/SpoqaHanSansNeo_WOFF2_Subset/SpoqaHanSansNeo-Medium.9d46d938dff0.woff2") format('woff2');
    font-weight: 500 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "WhaleMath Login";
    src: url("../../fonts/SpoqaHanSansNeo_WOFF2_Subset/SpoqaHanSansNeo-Bold.d57ff6f22085.woff2") format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.wm-login-page {
    --login-ink: var(--wm-mode-text, #302b50);
    --login-muted: var(--wm-mode-muted, #737087);
    --login-accent: var(--wm-mode-violet, #5943ac);
    --login-line: var(--wm-mode-line, #e4e2ee);
    --login-surface: var(--wm-mode-surface, #fff);
    --login-input-surface: var(--wm-mode-soft, #fff);
    --login-focus-color: var(--login-accent);
    --login-focus-ring: 0 0 0 3px rgb(126 99 210 / 14%), 0 0 14px rgb(117 182 255 / 8%);
    margin: 0;
    color: var(--login-ink);
    font-family: "WhaleMath Login", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    letter-spacing: -.025em;
    line-height: 1.5;
}

.wm-login-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 24px;
    background: radial-gradient(ellipse at 25% 12%, #a993ec18, transparent 48%),
        radial-gradient(ellipse at 85% 88%, #80c9e910, transparent 45%);
}

.wm-login-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 38px 39px 30px;
    border: 1px solid var(--login-line);
    border-radius: 24px;
    background: var(--login-surface);
    box-shadow: 0 12px 40px #34215e07, 0 2px 8px #34215e03;
}

.wm-login-header { margin-bottom: 36px; text-align: center; }
.wm-login-page .wm-cta.wm-cta { font-family: inherit; }
/* Contain allauth's off-screen anti-bot input without widening the page. */
.wm-signup-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.wm-login-brand { display: inline-flex; max-width: 100%; border-radius: 8px; vertical-align: top; }
.wm-login-logo { display: block; width: 240px; max-width: 100%; height: auto; }

.wm-login-field + .wm-login-field { margin-top: 18px; }
.wm-login-field label { display: block; margin-bottom: 8px; color: var(--login-ink); font-size: 14px; font-weight: 600; }
.wm-login-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wm-login-link { color: var(--login-accent); font-weight: 600; text-decoration: none; text-underline-offset: 4px; }
.wm-login-link:hover { text-decoration: underline; }
.wm-login-recovery { font-size: 13px; }
.wm-login-required { margin-left: 2px; color: var(--login-accent); font-weight: 500; }
.wm-login-help { margin-top: 8px; color: var(--login-muted); font-size: 12px; line-height: 1.6; word-break: keep-all; }
.wm-login-help ul { margin: 0; padding: 0; list-style: none; }

.wm-login-page input.wm-login-input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 13px 15px;
    border: 1px solid var(--login-line);
    border-radius: 12px;
    background: var(--login-input-surface);
    color: var(--login-ink);
    font: inherit;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -.02em;
    box-shadow: 0 1px 2px #24174603;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.wm-login-input::placeholder { color: var(--wm-mode-muted, #8c899d); opacity: 1; font-size: 14px; }
.wm-login-page .wm-login-input:focus {
    border-color: var(--login-focus-color);
    outline: none;
    box-shadow: var(--login-focus-ring);
}
.wm-login-page .wm-login-input.wm-login-input--invalid { border-color: var(--wm-mode-red, #c03655); }
/* Keep browser autofill legible without its unrelated blue fill or long-delay hacks. */
.wm-login-page .wm-login-input:is(:-webkit-autofill, :autofill) {
    -webkit-text-fill-color: var(--login-ink);
    caret-color: var(--login-ink);
    box-shadow: 0 0 0 1000px var(--login-input-surface) inset;
}
.wm-login-page .wm-login-input:is(:-webkit-autofill, :autofill):focus {
    box-shadow: 0 0 0 1000px var(--login-input-surface) inset, var(--login-focus-ring);
}
.wm-login-page .wm-password-field__toggle { width: 44px; height: 44px; right: 4px; border-radius: 9px; color: var(--login-muted); }

.wm-login-page .wm-login-form .wm-login-submit[type="submit"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    margin-top: 24px;
    padding: 12px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--wm-theme-primary-gradient, linear-gradient(135deg, #6d4aff, #4d3d99));
    color: #fff;
    box-shadow: inset 0 1px 0 #ffffff30, 0 5px 16px #a78bff30, 0 7px 20px #75b6ff0d;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 150ms ease, box-shadow 150ms ease;
}
.wm-login-page .wm-login-form .wm-login-submit:hover { filter: brightness(1.07); box-shadow: 0 7px 18px #6749bd30; }
.wm-login-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wm-login-page :is(a, button):focus-visible { outline: 3px solid var(--login-focus-color); outline-offset: 4px; }

.wm-login-divider { display: flex; align-items: center; gap: 16px; margin: 26px 0 20px; color: var(--login-muted); font-size: 12px; }
.wm-login-divider::before, .wm-login-divider::after { content: ""; flex: 1; height: 1px; background: var(--login-line); }
.wm-login-social { display: flex; justify-content: center; gap: 30px; }
.wm-login-provider { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 56px; padding: 2px; border-radius: 12px; color: var(--login-muted); font-size: 12px; text-decoration: none; }
button.wm-login-provider { border: 0; background: transparent; font-family: inherit; line-height: inherit; letter-spacing: inherit; cursor: pointer; }
.wm-login-provider:disabled { opacity: .65; cursor: wait; }
.wm-login-provider-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; transition: transform 150ms ease, box-shadow 150ms ease; }
.wm-login-provider-icon--naver { background: #03c75a; }
.wm-login-provider-icon--kakao { background: #fee500; }
.wm-login-provider-icon--google { background: #fff; box-shadow: inset 0 0 0 1px #e4e2eb; }
.wm-login-provider-icon img { display: block; width: 48px; height: 48px; }
.wm-login-provider:hover .wm-login-provider-icon { transform: translateY(-2px); }
.wm-login-provider:hover { color: var(--login-ink); }
.wm-login-signup { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin: 26px 0 0; color: var(--login-muted); font-size: 13px; }
.wm-login-signup a { white-space: nowrap; }
.wm-login-signed-in { text-align: center; color: var(--login-muted); font-size: 14px; }

.wm-login-error { margin: 6px 0 0; color: var(--wm-mode-red, #b52f4c); font-size: 13px; line-height: 1.6; }
.wm-login-error--summary { margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; background: var(--wm-mode-red-soft, #fff1f3); }
.wm-login-messages { margin-bottom: 20px; }
.wm-login-message { padding: 12px 14px; border: 1px solid var(--login-line); border-radius: 10px; font-size: 13px; }
.wm-login-message + .wm-login-message { margin-top: 8px; }
.wm-login-page .wm-trial-entry-notice { background: var(--wm-mode-violet-soft, #f4f0ff); border-color: var(--login-line); }
.wm-login-page .wm-trial-entry-notice h1 { color: var(--login-ink); }
.wm-login-page .wm-trial-entry-notice p, .wm-login-page .wm-trial-entry-notice > span { color: var(--login-muted); }

/* Recolor the mark first so the amber glow keeps its own color. */
html[data-wm-theme="dark"] .wm-login-logo {
    filter: brightness(0) invert(1)
        drop-shadow(0 0 2px rgb(255 220 132 / 80%))
        drop-shadow(0 0 7px rgb(255 189 66 / 48%))
        drop-shadow(0 0 18px rgb(255 156 39 / 22%));
}

/* Static accents keep the gold brand mark distinct from interactive controls. */
html[data-wm-theme="dark"] .wm-login-page {
    --login-focus-color: #69e6f5;
    --login-focus-ring: 0 0 0 3px rgb(105 230 245 / 13%), 0 0 20px rgb(105 230 245 / 14%);
}
html[data-wm-theme="dark"] .wm-login-panel {
    border-color: #424969;
    box-shadow: inset 0 1px 0 #a78bff16, 0 0 26px #a78bff0b, 0 16px 44px #0003;
}
html[data-wm-theme="dark"] .wm-login-page .wm-login-form .wm-login-submit[type="submit"] {
    box-shadow: inset 0 1px 0 #69e6f578, inset 0 0 0 1px #a78bff66,
        0 0 20px #a78bff38, 0 8px 24px #75b6ff24;
}
html[data-wm-theme="dark"] .wm-login-page .wm-login-form .wm-login-submit[type="submit"]:is(:hover, :focus-visible) {
    box-shadow: inset 0 1px 0 #69e6f5ad, inset 0 0 0 1px #a78bff8c,
        0 0 24px #a78bff52, 0 8px 28px #69e6f52b;
}
html[data-wm-theme="dark"] .wm-login-divider::before {
    background: linear-gradient(90deg, transparent, #a78bff66, #75b6ff8c);
    box-shadow: 0 0 7px #a78bff24;
}
html[data-wm-theme="dark"] .wm-login-divider::after {
    background: linear-gradient(90deg, #69e6f58c, #ef9dff66, transparent);
    box-shadow: 0 0 7px #69e6f524;
}

@media (max-width: 479px) {
    .wm-login-layout { padding: 32px 24px; background: var(--login-surface); }
    .wm-login-panel { max-width: 360px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
    .wm-login-logo { width: 220px; }
    html[data-wm-theme="dark"] .wm-login-panel { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wm-login-page *, .wm-login-page *::before, .wm-login-page *::after { transition: none; }
}

@media (forced-colors: active) {
    /* A fixed white backing keeps the original purple SVG readable in either contrast palette. */
    html[data-wm-theme] .wm-login-logo { filter: none; background: #fff; forced-color-adjust: none; }
    html[data-wm-theme] .wm-login-panel { background: Canvas; border-color: CanvasText; box-shadow: none; }
    html[data-wm-theme] .wm-login-page input.wm-login-input {
        background: Canvas;
        color: CanvasText;
        border-color: ButtonText;
        box-shadow: none;
    }
    html[data-wm-theme] .wm-login-page .wm-login-input:is(:-webkit-autofill, :autofill) {
        -webkit-text-fill-color: CanvasText;
        caret-color: CanvasText;
        box-shadow: none;
    }
    html[data-wm-theme] .wm-login-page .wm-login-form .wm-login-submit[type="submit"],
    html[data-wm-theme] .wm-login-page .wm-login-form .wm-login-submit[type="submit"]:is(:hover, :focus-visible) {
        background: ButtonFace;
        color: ButtonText;
        border: 1px solid ButtonText;
        box-shadow: none;
        filter: none;
    }
    html[data-wm-theme] .wm-login-page :is(input:focus, a:focus-visible, button:focus-visible) {
        outline: 2px solid Highlight;
        outline-offset: 3px;
    }
    html[data-wm-theme] .wm-login-divider::before,
    html[data-wm-theme] .wm-login-divider::after { background: GrayText; box-shadow: none; }
}
