*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --sriphat-navy: #5f4b8b;
    --sriphat-navy-deep: #46356e;
    --sriphat-teal: #7866a7;
    --sriphat-mint: #c9bde4;
    --sriphat-ice: #f3f0fa;
    --panel-bg: #ffffff;
    --panel-line: #ddd5ee;
    --text-main: #31254b;
    --text-muted: #766992;
}

body {
    margin: 0;
    font-family: "Manrope", "Noto Sans Thai", "Segoe UI", sans-serif;
    color: var(--text-main);
    background: #ffffff;
    min-height: 100vh;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-wrapper {
    display: flex;
    width: 900px;
    max-width: 100%;
    min-height: 560px;
    border-radius: 22px;
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--panel-line);
    box-shadow: 0 24px 64px rgba(70, 53, 110, 0.2);
}

.login-brand {
    flex: 0 0 42%;
    background: linear-gradient(162deg, var(--sriphat-navy-deep) 0%, var(--sriphat-navy) 48%, var(--sriphat-teal) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.login-brand::before,
.login-brand::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.login-brand::before {
    width: 320px;
    height: 320px;
    top: -90px;
    right: -90px;
}

.login-brand::after {
    width: 220px;
    height: 220px;
    bottom: -70px;
    left: -70px;
}

.brand-icon-wrap {
    width: 96px;
    height: 96px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 26px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.brand-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-title,
.brand-subtitle,
.brand-badge {
    position: relative;
    z-index: 1;
    text-align: center;
}

.brand-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 12px;
}

.brand-subtitle {
    color: rgba(225, 245, 255, 0.86);
    font-size: 13px;
    font-weight: 300;
    line-height: 1.75;
    max-width: 260px;
}

.brand-badge {
    margin-top: 32px;
    background: rgba(201, 189, 228, 0.24);
    border: 1px solid rgba(235, 229, 248, 0.55);
    border-radius: 20px;
    padding: 6px 18px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.login-form-panel {
    flex: 1;
    background:
        radial-gradient(circle at 100% 8%, rgba(120, 102, 167, 0.24) 0%, transparent 42%),
        radial-gradient(circle at 88% 84%, rgba(95, 75, 139, 0.14) 0%, transparent 46%),
        linear-gradient(180deg, #ffffff 0%, #fbf9ff 58%, #f4f0fb 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 44px;
    position: relative;
    overflow: hidden;
}

.login-form-panel::before,
.login-form-panel::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.login-form-panel::before {
    width: 320px;
    height: 320px;
    right: -160px;
    top: -96px;
    background: radial-gradient(circle, rgba(120, 102, 167, 0.2) 0%, rgba(120, 102, 167, 0) 68%);
}

.login-form-panel::after {
    width: 260px;
    height: 260px;
    right: -110px;
    bottom: -130px;
    background: radial-gradient(circle, rgba(95, 75, 139, 0.16) 0%, rgba(95, 75, 139, 0) 68%);
}

.login-form-shell {
    position: relative;
    z-index: 1;
}

.login-form-shell {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 34px;
    width: 100%;
}

.form-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--sriphat-navy);
    margin: 0 0 6px;
}

.form-header p {
    font-size: 13px;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0;
}

.form-divider {
    width: 44px;
    height: 3px;
    background: linear-gradient(90deg, var(--sriphat-navy), var(--sriphat-teal));
    border-radius: 2px;
    margin: 10px auto 0;
}

.auth-alert {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 18px;
    display: grid;
    gap: 4px;
    border-left: 4px solid transparent;
}

.auth-alert strong {
    font-size: 13px;
    font-weight: 600;
}

.auth-alert span {
    font-weight: 400;
}

.auth-alert ul {
    margin: 2px 0 0;
    padding-left: 18px;
}

.auth-alert-success {
    background: #ecfcf9;
    border: 1px solid #a9efe7;
    color: #0a6d65;
    border-left-color: #0a6d65;
}

.auth-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-left-color: #d97706;
}

.auth-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-left-color: #dc2626;
}

.field-group {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
}

.field-group input {
    width: 100%;
    padding: 13px 44px 13px 14px;
    border: 2px solid #dbd2ea;
    border-radius: 12px;
    font-family: "Manrope", "Noto Sans Thai", "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: var(--text-main);
    background: #f7f4fd;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    outline: none;
}

.field-group input:focus {
    border-color: var(--sriphat-teal);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(95, 75, 139, 0.18);
}

.field-group input::placeholder {
    color: #aa9dc6;
    font-weight: 300;
}

.field-error {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #b91c1c;
    font-weight: 400;
    line-height: 1.45;
}

.field-group input.is-invalid {
    border-color: #ef4444;
    background: #fff7f7;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.eye-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #8b7ea8;
    background: none;
    border: none;
    padding: 0;
}

.eye-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.eye-toggle .icon-eye-off {
    display: none;
}

.eye-toggle.is-visible .icon-eye {
    display: none;
}

.eye-toggle.is-visible .icon-eye-off {
    display: block;
}

.eye-toggle:hover,
.eye-toggle:focus-visible {
    color: var(--sriphat-teal);
}

.eye-toggle:focus-visible {
    outline: 2px solid var(--sriphat-teal);
    outline-offset: 2px;
    border-radius: 6px;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 6px 0 18px;
    font-size: 13px;
}

.remember-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.remember-wrap input {
    accent-color: var(--sriphat-teal);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--sriphat-navy) 0%, var(--sriphat-teal) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: "Manrope", "Noto Sans Thai", "Segoe UI", sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 7px 22px rgba(95, 75, 139, 0.35);
    margin-top: 6px;
    letter-spacing: 0.4px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 30px rgba(95, 75, 139, 0.48);
}

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

.copyright {
    margin-top: 30px;
    font-size: 11px;
    color: #a294bf;
    text-align: center;
    font-weight: 300;
}

@media (max-width: 680px) {
    .auth-page {
        padding: 16px;
    }

    .login-brand {
        display: none;
    }

    .login-form-panel {
        padding: 40px 24px;
        background: linear-gradient(180deg, #ffffff 0%, #f9f6ff 100%);
    }

    .login-form-panel::before,
    .login-form-panel::after {
        display: none;
    }

    .login-wrapper {
        border-radius: 16px;
        min-height: auto;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}
