:root {
    --bg: #050505;
    --bg-soft: #090909;
    --surface: #0d0d0f;
    --surface-hover: #151517;
    --border: #252527;
    --border-light: #343438;
    --text: #f5f5f5;
    --text-secondary: #a5a7ab;
    --text-muted: #73767c;
    --silver: #c2c5ca;
    --accent: #f4b900;
    --accent-hover: #ffd028;
    --success: #39c978;
    --danger: #ef5350;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 18%, rgba(244, 185, 0, 0.06), transparent 26rem),
        var(--bg);
    font-family: "Noto Sans Thai", "Noto Serif Lao", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

.auth-page {
    overflow-x: hidden;
    font-family: "Noto Sans Thai", "Noto Serif Lao", sans-serif;
}

.auth-shell {
    width: min(620px, calc(100% - 40px));
    min-height: min(760px, calc(100vh - 64px));
    margin: 32px auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.form-panel {
    display: grid;
    place-items: center;
    padding: 44px clamp(28px, 6vw, 76px);
    background: var(--surface);
}

.auth-card {
    width: min(100%, 460px);
}

.auth-logo {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-bottom: 26px;
    color: var(--silver);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .2em;
}

.auth-logo img {
    display: block;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: contain;
}

.auth-header {
    margin-bottom: 28px;
    text-align: center;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .26em;
}

.auth-header h1 {
    margin: 8px 0 6px;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    letter-spacing: -.035em;
}

.auth-header>p:last-child {
    margin: 0;
    color: var(--text-secondary);
}

.auth-form {
    display: grid;
    gap: 17px;
}

.field label {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--silver);
    font-size: .86rem;
    font-weight: 650;
}

.input-wrap {
    position: relative;
}

.input-wrap>i {
    position: absolute;
    left: 16px;
    top: 50%;
    z-index: 1;
    color: var(--text-muted);
    font-size: 1.25rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 48px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    caret-color: var(--accent);
    background: #09090a;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.input-wrap input::placeholder {
    color: #565960;
}

.input-wrap input:hover {
    background: #0b0b0c;
}

.input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(244, 185, 0, .1);
}

.input-wrap:focus-within>i {
    color: var(--accent);
}

.password-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    color: var(--text-muted);
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--text);
    background: var(--surface-hover);
    outline: none;
}

.password-toggle i {
    font-size: 1.2rem;
}

.field-error {
    min-height: 0;
    margin: 5px 2px 0;
    color: var(--danger);
    font-size: .78rem;
}

.field-error:empty {
    display: none;
}

.has-error .input-wrap input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 83, 80, .09);
}

.check-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 0 !important;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
    line-height: 1.55;
    cursor: pointer;
}

.check-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-check {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-light);
    border-radius: 5px;
    background: #09090a;
}

.custom-check i {
    opacity: 0;
    color: #080808;
    font-size: 1rem;
    font-weight: 900;
}

.check-label input:checked+.custom-check {
    border-color: var(--accent);
    background: var(--accent);
}

.check-label input:checked+.custom-check i {
    opacity: 1;
}

.check-label input:focus-visible+.custom-check {
    box-shadow: 0 0 0 3px rgba(244, 185, 0, .16);
}

.check-label a {
    margin: 0 4px;
    color: var(--silver);
    text-underline-offset: 3px;
}

.check-label a:hover {
    color: var(--accent);
}

.submit-button {
    width: 100%;
    min-height: 52px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    color: #090909;
    background: var(--accent);
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease, opacity .16s ease;
}

.submit-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.submit-button:focus-visible {
    outline: 3px solid rgba(244, 185, 0, .25);
    outline-offset: 2px;
}

.submit-button:disabled {
    opacity: .65;
    cursor: wait;
}

.submit-button.is-loading i {
    animation: button-spin .8s linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

.mwoif-swal {
    border: 1px solid var(--border-light);
    border-radius: 18px;
    color: var(--text);
    background: #101012;
    font-family: "Noto Sans Thai", "Noto Serif Lao", sans-serif;
}

.mwoif-swal .swal2-title {
    color: var(--text);
}

.mwoif-swal .swal2-html-container {
    color: var(--text-secondary);
}

.mwoif-swal-button {
    min-width: 112px;
    padding: 11px 24px;
    border: 0;
    border-radius: 10px;
    color: #090909;
    background: var(--accent);
    font-weight: 800;
    cursor: pointer;
}

.mwoif-swal-button:focus-visible {
    outline: 3px solid rgba(244, 185, 0, .22);
}

@media (max-width: 780px) {
    .auth-shell {
        width: min(100% - 24px, 560px);
        min-height: auto;
        margin: 18px auto;
    }

    .form-panel {
        padding: 32px clamp(20px, 6vw, 42px) 38px;
    }
}

@media (max-width: 390px) {
    .auth-shell {
        width: 100%;
        margin: 0;
        border-width: 0;
        border-radius: 0;
    }

    .form-panel {
        padding: 26px 17px 34px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .input-wrap input {
        padding-left: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}


/* Website Settings status notices */
.auth-status-notice {
    display: flex;
    gap: 11px;
    margin: 0 0 18px;
    padding: 13px 14px;
    border: 1px solid #303035;
    border-radius: 10px;
    color: #d9d9dc;
    background: #111113;
}

.auth-status-notice>i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: #f4b900;
    font-size: 1.2rem;
}

.auth-status-notice div {
    min-width: 0;
}

.auth-status-notice strong {
    display: block;
    color: #f4f4f5;
    font-size: .82rem;
}

.auth-status-notice p {
    margin: 3px 0 0;
    color: #989aa0;
    font-size: .72rem;
    line-height: 1.55;
}

.auth-status-notice--warning {
    border-color: rgba(244, 185, 0, .28);
    background: rgba(244, 185, 0, .045);
}
/* Cloudflare Turnstile */
.mwoif-turnstile {
    width: 100%;
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px 0 4px;
}

.mwoif-turnstile .cf-turnstile {
    width: 100%;
    min-width: 0;
}

.mwoif-turnstile--unavailable {
    min-height: 50px;
    border: 1px solid rgba(244, 185, 0, .22);
    border-radius: 10px;
    padding: 12px 14px;
    color: #c7aa4a;
    background: rgba(244, 185, 0, .045);
    font-size: .76rem;
    line-height: 1.5;
    text-align: center;
}
