@import url("https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
    --gold-deep: #8b6914;
    --gold-dark: #b8860b;
    --gold: #d4a843;
    --gold-bright: #f5c842;
    --gold-light: #ffd966;
    --gold-pale: #fff5d6;
    --gold-cream: #f5e8c0;
    --field-cream: #f9efd0;
    --field-text: #4a3210;
    --bg-dark-1: #050b1a;
    --bg-dark-2: #0a1530;
    --bg-dark-3: #152545;
    --navy-deep: #04091a;
    --navy: #0e1f3d;
    --navy-mid: #1c3158;
}

* {
    box-sizing: border-box;
}

body {
    color: #fff5e0;
    font-family: "Kanit", sans-serif;
    margin: 0;
    background: var(--bg-dark-1);
}

/* ── Page background: dark + gold sparkles ── */
.auth-container {
    position: relative;
    background-image: url("../member_asset/images/theme/shabu/bg.png");
    background-attachment: fixed;
    display: block;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px 12px;
    overflow-x: hidden;
}

.auth-container::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    border: 1px solid var(--gold);
    background-image:
        radial-gradient(
            1.5px 1.5px at 8% 12%,
            rgba(255, 217, 102, 0.9),
            transparent 60%
        ),
        radial-gradient(
            1px 1px at 18% 28%,
            rgba(223, 230, 242, 0.6),
            transparent 60%
        ),
        radial-gradient(
            2px 2px at 6% 48%,
            rgba(245, 200, 66, 0.8),
            transparent 60%
        ),
        radial-gradient(
            1px 1px at 14% 72%,
            rgba(140, 175, 235, 0.55),
            transparent 60%
        ),
        radial-gradient(
            1.5px 1.5px at 4% 88%,
            rgba(255, 217, 102, 0.7),
            transparent 60%
        ),
        radial-gradient(
            2px 2px at 92% 14%,
            rgba(245, 200, 66, 0.85),
            transparent 60%
        ),
        radial-gradient(
            1px 1px at 86% 36%,
            rgba(223, 230, 242, 0.55),
            transparent 60%
        ),
        radial-gradient(
            1.5px 1.5px at 96% 58%,
            rgba(255, 217, 102, 0.7),
            transparent 60%
        ),
        radial-gradient(
            1px 1px at 88% 78%,
            rgba(140, 175, 235, 0.45),
            transparent 60%
        ),
        radial-gradient(
            2px 2px at 94% 92%,
            rgba(245, 200, 66, 0.6),
            transparent 60%
        ),
        radial-gradient(
            1px 1px at 30% 4%,
            rgba(223, 230, 242, 0.55),
            transparent 60%
        ),
        radial-gradient(
            1.5px 1.5px at 60% 8%,
            rgba(255, 217, 102, 0.6),
            transparent 60%
        ),
        radial-gradient(
            2px 2px at 75% 6%,
            rgba(245, 200, 66, 0.7),
            transparent 60%
        );
    animation: sparkleTwinkle 4s ease-in-out infinite alternate;
}

@keyframes sparkleTwinkle {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* ── Wrappers ── */
.login-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    padding: 5% 2%;
    box-sizing: border-box;
    background:
        linear-gradient(
                180deg,
                rgba(14, 31, 61, 0.97) 0%,
                rgba(4, 9, 26, 0.99) 100%
            )
            padding-box,
        linear-gradient(
                135deg,
                #8b6914 0%,
                #ffd966 25%,
                #fff5d6 45%,
                #f5c842 65%,
                #8b6914 100%
            )
            border-box;
    border: 3px solid transparent;
    border-radius: 18px;
    box-shadow:
        0 0 30px rgba(245, 200, 66, 0.28),
        0 10px 30px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 217, 102, 0.15);
    margin: 0 auto;
    margin-top: -5%;
}

.logo-login {
    position: sticky;
    width: 100%;
    max-width: 250px;
    height: auto;
    z-index: 9;
}

.register-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    background:
        linear-gradient(
                180deg,
                rgba(14, 31, 61, 0.97) 0%,
                rgba(4, 9, 26, 0.99) 100%
            )
            padding-box,
        linear-gradient(
                135deg,
                #8b6914 0%,
                #ffd966 25%,
                #fff5d6 45%,
                #f5c842 65%,
                #8b6914 100%
            )
            border-box;
    border: 3px solid transparent;
    border-radius: 18px;
    box-shadow:
        0 0 30px rgba(245, 200, 66, 0.28),
        0 10px 30px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 217, 102, 0.15);
    margin: 0 auto;
    margin-top: -5%;
    padding: 5% 2%;
}

.img-register {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* ── Logo ── */
.register-logo {
    position: sticky;
    width: 100%;
    max-width: 300px;
    height: auto;
    z-index: 9;
}

/* ── Title: "Login" + เข้าสู่ระบบ rule ── */
.login-title {
    margin-bottom: 24px;
}

.login-heading {
    position: relative;
    display: inline-block;
    margin: 0;
    font-family: "Georgia", "Times New Roman", serif;
    font-weight: 700;
    font-size: 3rem;
    line-height: 1.1;
    letter-spacing: 1px;
    background: linear-gradient(
        180deg,
        #fff5d6 0%,
        #ffe08a 35%,
        #f5c842 60%,
        #d4a843 85%,
        #b8860b 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--gold-light);

}



.login-heading::before {
    left: -1.4em;
}

.login-heading::after {
    right: -1.4em;
}

.login-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.login-subtitle .title-rule {
    width: 48px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold) 60%,
        var(--gold-light)
    );
}

.login-subtitle .title-rule:last-child {
    background: linear-gradient(
        270deg,
        transparent,
        var(--gold) 60%,
        var(--gold-light)
    );
}

.login-subtitle .title-text {
    color: white;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(245, 200, 66, 0.4);
}

/* ── Subtitle ── */
.alert.bg-transparent {
    color: var(--gold-pale) !important;
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 14px;
    text-shadow: 0 0 8px rgba(245, 200, 66, 0.35);
}

.card-body.fc-2,
.card-body {
    background: transparent;
    padding: 0;
}

/* ── Form layout ── */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    color: var(--gold-pale);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 4px;
    margin-left: 6px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ── Input group: dark navy pill + gold gradient border + dark icon circle ── */
.login-wrapper .input-group {
    position: relative;
    display: flex;
    align-items: center;
    background:
        linear-gradient(180deg, #15294e 0%, #0a1730 60%, #081226 100%)
            padding-box,
        linear-gradient(
                135deg,
                #8b6914 0%,
                #ffd966 20%,
                #fff5d6 35%,
                #f5c842 50%,
                #fff5d6 65%,
                #ffd966 80%,
                #8b6914 100%
            )
            border-box;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 7px 16px 7px 7px;
    overflow: visible;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.55),
        0 0 16px rgba(245, 200, 66, 0.18),
        inset 0 1px 2px rgba(255, 217, 102, 0.12);
    flex-wrap: nowrap;
}

.input-group-prepend {
    display: flex;
    align-items: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.input-group-text {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 25%, #1c3158 0%, #04091a 100%) padding-box,
        linear-gradient(
                135deg,
                #8b6914 0%,
                #ffd966 25%,
                #fff5d6 45%,
                #f5c842 65%,
                #8b6914 100%
            )
            border-box;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--gold-light);
    padding: 0;
}

.input-group-text i {
    font-size: 1rem;
    color: var(--gold-light);

}

/* ── Inputs ── */
.login-wrapper .input-form {
    flex: 1;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    color: var(--gold-pale) !important;
    font-family: "Kanit", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 8px;
    outline: none !important;
    box-shadow: none !important;
    height: auto;
}

.login-wrapper .input-form:-webkit-autofill,
.login-wrapper .input-form:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--gold-pale);
    -webkit-box-shadow: 0 0 0 1000px #0a1730 inset;
    caret-color: var(--gold-pale);
}

.input-form::placeholder,
.form-control::placeholder {
    color: rgba(255, 245, 224, 0.55);
    font-weight: 400;
}

/* ── Password reveal toggle ── */
.password-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: 6px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--gold-light);
    font-size: 1.05rem;
    cursor: pointer;
    transition:
        color 0.2s ease,
        text-shadow 0.2s ease;
    text-shadow: 0 0 8px rgba(245, 200, 66, 0.45);
}

.password-toggle:hover {
    color: var(--gold-bright);
    text-shadow: 0 0 12px rgba(245, 200, 66, 0.7);
}

/* ── Buttons (shared base) ── */
.btn-register,
.btn-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    border: 2px solid transparent;
    font-family: "Kanit", sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    border-radius: 14px;
    padding: 13px 24px;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    overflow: hidden;
    transition:
        filter 0.3s ease,
        transform 0.2s ease;
}

/* Login: glowing blue pill with gold edge + arrow chip */
.btn-login {
    margin-top: 4px;
    background:
        linear-gradient(
                180deg,
                #2a4f96 0%,
                #1f3f7e 30%,
                #1b377a 50%,
                #102a5e 78%,
                #0b1f47 100%
            )
            padding-box,
        linear-gradient(
                135deg,
                #8b6914 0%,
                #ffd966 25%,
                #fff5d6 45%,
                #f5c842 65%,
                #8b6914 100%
            )
            border-box;
    color: white;
}

.btn-login .btn-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    color: var(--gold-light);
    font-size: 0.9rem;
    box-shadow:
        0 0 10px rgba(245, 200, 66, 0.4),
        inset 0 0 6px rgba(245, 200, 66, 0.15);
}

/* Register: dark navy pill with gold edge + person-plus icon */
.btn-register {
    background-color: #0a1730;
    color: var(--gold-light);
    border: 2px solid #d4a843;
}

.btn-register .btn-icon-left {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    color: var(--gold-light);
    font-size: 1.1rem;
}

.btn-login::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(180, 210, 255, 0.45),
        transparent
    );
    transform: skewX(-25deg);
    animation: btnShine 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btnShine {
    0%,
    60% {
        left: -120%;
    }
    100% {
        left: 130%;
    }
}

.btn-register:hover,
.btn-login:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-register:active,
.btn-login:active {
    transform: translateY(0);
}

/* ── "หรือ" divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold) 45%,
        var(--gold-light) 50%,
        var(--gold) 55%,
        transparent
    );
}

.auth-divider-text {
    color: var(--gold-light);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(245, 200, 66, 0.4);
}

/* ── Login link ── */
.register-wrapper a.text-white,
.login-wrapper a.text-white,
.text-white.text-decoration-none {
    color: var(--gold-light) !important;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: text-shadow 0.3s;
}

.register-wrapper a.text-white:hover,
.login-wrapper a.text-white:hover {
    text-shadow: 0 0 10px rgba(245, 200, 66, 0.6);
}

/* ── Remember-me checkbox ── */
.form-check-label.text-white {
    color: var(--gold-pale) !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding-left: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.form-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid var(--gold);
    border-radius: 4px;
    background: radial-gradient(circle at 30% 25%, #1c3158 0%, #04091a 100%);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 0 6px rgba(245, 200, 66, 0.3);
    flex-shrink: 0;
}

.form-check-input:checked {
    background: radial-gradient(
        circle at 30% 25%,
        #fff5d6 0%,
        #ffd966 30%,
        #d4a843 70%,
        #8b6914 100%
    );
    border-color: var(--gold-light);
    box-shadow:
        0 0 10px rgba(245, 200, 66, 0.55),
        inset 0 1px 1px rgba(255, 245, 214, 0.6);
}

.form-check-input:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    color: #4a2e08;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

/* ── Contact box ── */
.contact-box {
    position: relative;
    background: linear-gradient(
        180deg,
        rgba(14, 31, 61, 0.97) 0%,
        rgba(4, 9, 26, 1) 100%
    );
    border: 1px solid var(--gold);
    color: var(--gold-pale);
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 500;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.contact-box .icon-line {
    width: 100%;
    max-width: 65px;
    height: auto;
}

/* ── Alerts ── */
.alert-danger {
    background: rgba(120, 30, 40, 0.25);
    border: 1px solid rgba(245, 200, 66, 0.4);
    color: #ffd0d0;
    border-radius: 10px;
    backdrop-filter: blur(8px);
}

/* ── Responsive ──
   For max-width queries, order largest → smallest so the narrower
   breakpoint can override the wider one through the cascade. */
@media (max-width: 1439px) {
    .login-wrapper {
        padding: 15% 10%;
        margin-top: -15%;
    }
    .register-wrapper {
        margin-top: -5%;
        padding: 5% 3%;
    }

    .contact-box .icon-line {
        width: 65px;
        height: auto;
    }
}

@media (max-width: 1024px) {
    .login-wrapper {
        padding: 10% 4%;
        margin-top: -10%;
    }
    .register-wrapper {
        margin-top: -8%;
        padding: 8% 5%;
    }
}

@media (max-width: 768px) {
    .register-wrapper {
        margin-top: -10%;
        padding: 10% 5%;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 16px 8px;
    }

    .login-wrapper {
        padding: 15% 5%;
        margin-top: -20%;
    }

    .register-wrapper {
        margin-top: -19%;
        padding: 15% 5%;
    }

    .alert.bg-transparent {
        font-size: 0.8rem;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .input-group-text {
        width: 34px;
        height: 34px;
    }

    .btn-register,
    .btn-login {
        font-size: 0.95rem;
        padding: 9px 16px;
    }

    .btn-register.btn-register--solo {
        font-size: 1rem;
        padding: 11px 36px;
        min-width: 200px;
    }

    .contact-box {
        font-size: 0.84rem;
        padding: 12px 10px;
    }
    .contact-box .icon-line {
        width: 55px;
        height: auto;
    }
    .register-logo {
        max-width: 270px;
    }
}

@media (max-width: 375px) {
    .login-wrapper {
        padding: 15% 5%;
        margin-top: -20%;
    }
    .contact-box .icon-line {
        width: 55px;
        height: auto;
    }
    .register-logo {
        max-width: 250px;
    }
}

@media (max-width: 320px) {
    .login-wrapper {
        padding: 25% 15%;
        margin-top: -25%;
    }

    .register-logo {
        max-width: 250px;
    }
}
