/* โมดัลสมัคร / เข้าสู่ระบบ — น้ำเงินเข้ม + ทอง (อ้างอิงมือถือ VELA-style) */
:root {
    --auth-gold: #f2c94c;
    --auth-gold-bright: #ffe9a0;
    --auth-navy: #0c1433;
    --auth-panel: #0c1433;
    --auth-border: rgba(255, 212, 120, 0.2);
}

.modal-dialog-auth {
    max-width: min(920px, calc(100vw - 1.25rem));
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767.98px) {
    .modal-dialog-auth {
        max-width: calc(100vw - 0.75rem);
        margin: 0.35rem auto;
    }
}

.auth-modal-card.modal-content {
    position: relative;
    border: 1px solid var(--auth-border);
    border-radius: 1.25rem;
    overflow: hidden;
    background: linear-gradient(180deg, #101a42 0%, var(--auth-navy) 38%, #080f24 100%);
    box-shadow:
        0 0 0 1px rgba(255, 200, 80, 0.05),
        0 24px 64px rgba(0, 0, 0, 0.75),
        0 0 80px rgba(20, 40, 90, 0.2);
}

@media (max-width: 767.98px) {
    .auth-modal-card.modal-content {
        border-radius: 1.35rem;
    }
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    opacity: 0.75;
    padding: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.auth-modal-close:hover {
    opacity: 1;
    background: rgba(196, 30, 58, 0.35);
    transform: scale(1.05);
}

.auth-modal-layout {
    display: flex;
    min-height: 420px;
    align-items: stretch;
}

.auth-modal-aside {
    flex: 0 0 38%;
    max-width: 340px;
    padding: 2rem 1.5rem;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(255, 200, 80, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(43, 142, 242, 0.12), transparent 50%),
        linear-gradient(165deg, #12183e 0%, #0a0f28 55%, #070a1c 100%);
    border-right: 1px solid var(--auth-border);
    position: relative;
}

.auth-modal-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(125deg, transparent 45%, rgba(255, 230, 160, 0.04) 50%, transparent 58%);
}

.auth-aside-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--auth-navy);
    background: linear-gradient(90deg, var(--auth-gold-bright), var(--auth-gold));
    padding: 6px 12px;
    border-radius: 999px;
    width: fit-content;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.auth-aside-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.auth-aside-title span {
    background: linear-gradient(90deg, #a8e6ff, var(--auth-gold-bright));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-aside-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.auth-aside-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: rgba(226, 236, 255, 0.88);
}

.auth-aside-list i {
    margin-top: 2px;
    color: var(--auth-gold);
    flex-shrink: 0;
}

.auth-modal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.5rem 1.5rem;
}

@media (max-width: 767.98px) {
    .auth-modal-layout {
        min-height: 0;
    }
    .auth-modal-main {
        padding: 2.75rem 1.15rem 1.35rem;
    }
}

.auth-modal-brand {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-modal-brand img.auth-logo {
    max-height: 52px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(242, 201, 76, 0.25));
}

.auth-modal-brand .auth-fallback-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.auth-modal-brand .auth-fallback-title .auth-ft-gold {
    background: linear-gradient(90deg, #fff8e8, var(--auth-gold-bright));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-modal-brand .auth-fallback-title .auth-ft-white {
    color: rgba(255, 255, 255, 0.96);
}

#auth-welcome-text,
.auth-modal-subline {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    color: rgba(220, 228, 248, 0.82);
    line-height: 1.5;
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
}

.auth-segment {
    display: flex;
    flex-direction: row;
    padding: 5px;
    margin: 0 auto 1.1rem;
    max-width: 100%;
    width: min(100%, 400px);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    gap: 5px;
}

.auth-segment__btn {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 999px;
    padding: 0.62rem 0.5rem;
    font-weight: 700;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
}

.auth-segment__btn i {
    font-size: 0.85em;
    opacity: 0.85;
}

.auth-segment__btn:hover {
    color: rgba(255, 255, 255, 0.82);
}

.auth-segment__btn:focus-visible {
    outline: 2px solid var(--auth-gold-bright);
    outline-offset: 2px;
}

.auth-segment__btn.active {
    color: #141010;
    background: linear-gradient(180deg, #fff4c8, var(--auth-gold) 42%, #d4a82a);
    box-shadow: 0 4px 16px rgba(242, 201, 76, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.auth-modal-body-inner {
    flex: 1;
    overflow-y: auto;
    max-height: min(58vh, 520px);
    padding-right: 6px;
    margin-right: -4px;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .auth-modal-body-inner {
        max-height: min(68dvh, 520px);
    }
}

.auth-modal-body-inner::-webkit-scrollbar {
    width: 4px;
}
.auth-modal-body-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 200, 100, 0.28);
    border-radius: 999px;
}

.auth-form .auth-field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(210, 224, 248, 0.82);
    margin-bottom: 6px;
}

.auth-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input-wrap:focus-within {
    border-color: rgba(242, 201, 76, 0.45);
    background: rgba(242, 201, 76, 0.06);
    box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.12);
}

.auth-input-wrap .input-group-text {
    border: 0 !important;
    border-radius: 0 !important;
    padding-left: 14px;
    padding-right: 10px;
    color: var(--auth-gold) !important;
    background: transparent !important;
}

.auth-input-wrap .form-control,
.auth-input-wrap .form-select {
    flex: 1;
    min-width: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    color: #fff !important;
    background: transparent !important;
    font-size: 0.95rem;
}

.auth-input-wrap .form-control::placeholder {
    color: rgba(255, 255, 255, 0.28) !important;
}

.auth-input-wrap .form-select option {
    background: var(--auth-panel);
    color: #fff;
}

.auth-btn-submit {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.03em;
    color: #1a1204;
    background: linear-gradient(180deg, #fff0b0, var(--auth-gold) 40%, #b8891a);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 8px 28px rgba(242, 201, 76, 0.28),
        0 2px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.auth-btn-submit:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 12px 32px rgba(242, 201, 76, 0.32);
}

.auth-btn-submit:focus-visible {
    outline: 2px solid var(--auth-gold-bright);
    outline-offset: 3px;
}

.auth-reg-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
}

.auth-reg-progress {
    display: flex;
    gap: 6px;
}

.auth-reg-progress__seg {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.auth-reg-progress__seg.is-active {
    background: linear-gradient(90deg, #4da3ff, #8fd4ff);
    box-shadow: 0 0 12px rgba(100, 190, 255, 0.35);
}

.auth-reg-progress__seg.is-done {
    background: rgba(100, 190, 255, 0.55);
}

.auth-btn-submit--magenta {
    color: #fff !important;
    background: linear-gradient(180deg, #c94b7a 0%, #80334d 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 8px 28px rgba(163, 62, 94, 0.35),
        0 2px 0 rgba(0, 0, 0, 0.2);
}

.auth-btn-submit--magenta:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 12px 32px rgba(163, 62, 94, 0.4);
}

.auth-reg-illus {
    margin-top: 0.25rem;
}

.auth-reg-illus__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    font-size: 1.75rem;
    color: #5eb3ff;
    background: radial-gradient(circle at 30% 25%, rgba(255, 120, 180, 0.35), transparent 55%),
        rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-reg-terms .form-check-input {
    margin-top: 0.2rem;
    border-color: rgba(255, 255, 255, 0.35);
}

.auth-reg-terms .form-check-input:checked {
    background-color: #5eb3ff;
    border-color: #5eb3ff;
}

.auth-reg-terms a {
    color: var(--auth-gold-bright);
}

.auth-footnote {
    text-align: center;
    font-size: 0.86rem;
    color: rgba(185, 200, 230, 0.7);
}

.auth-footnote a {
    color: var(--auth-gold-bright);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 224, 138, 0.35);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.auth-footnote a:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.45);
}

/* legacy class names used in markup */
.modern-input-group {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.modern-input-group:focus-within {
    box-shadow: none !important;
    background: transparent !important;
}

.auth-modal-card input:-webkit-autofill,
.auth-modal-card input:-webkit-autofill:hover,
.auth-modal-card input:-webkit-autofill:focus,
.auth-modal-card textarea:-webkit-autofill,
.auth-modal-card select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(12, 20, 51, 0.98) inset !important;
    box-shadow: 0 0 0 1000px rgba(12, 20, 51, 0.98) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #fff;
    transition: background-color 99999s ease-out;
}

/* พื้นหลังมืดขึ้นเมื่อเปิดโมดอล (เบราว์เซอร์ที่รองรับ :has) */
@supports selector(body:has(#authModal.show)) {
    body:has(#authModal.show) .modal-backdrop {
        --bs-backdrop-bg: #020308;
        --bs-backdrop-opacity: 0.78;
    }
}


@media (prefers-reduced-motion: reduce) {
    .auth-modal-close,
    .auth-btn-submit,
    .auth-segment__btn {
        transition: none;
    }
    .auth-btn-submit:hover {
        transform: none;
    }
}
