/* ---------------------------------------------------------------------------
   Info Counter Satisfaction Kiosk — สไตล์เฉพาะทางที่เสริมจาก Tailwind
   ธีม: Clean Minimal (ขาว / Indigo) — border-first design, ไม่ใช้เงา
   --------------------------------------------------------------------------- */

:root {
    /* Accent (Indigo) */
    --accent-50: #EEF2FF;
    --accent-500: #6366F1;
    --accent-600: #4F46E5;

    /* พื้นผิว */
    --bg: #FFFFFF;
    --bg-subtle: #FAFAFA;
    --surface: #FFFFFF;

    /* ตัวอักษร */
    --text: #18181B;
    --text-2: #71717A;
    --text-3: #A1A1AA;

    /* เส้นขอบ */
    --border: #E4E4E7;
    --border-light: #F4F4F5;

    /* คะแนน 1-5 */
    --score-1: #EF4444;
    --score-2: #F97316;
    --score-3: #EAB308;
    --score-4: #22C55E;
    --score-5: #16A34A;

    /* สถานะ */
    --info: #3B82F6;
    --success-bg: #F0FDF4;
    --danger-bg: #FEF2F2;

    --radius: 12px;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body.app-body {
    background-color: var(--bg-subtle);
    color: var(--text);
    font-family: "Inter", "IBM Plex Sans Thai", ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.page-layer {
    position: relative;
    z-index: 1;
}

/* ------------------------------------------------------------------- card */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card-hover:hover {
    border-color: #C7D2FE;
    transition: border-color .15s ease;
}

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .55rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn-primary {
    background: var(--accent-600);
    color: #fff;
}

.btn-primary:hover {
    background: #4338CA;
}

.btn-secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #FAFAFA;
}

.btn-danger {
    background: #fff;
    border-color: #FECACA;
    color: #B91C1C;
}

.btn-danger:hover {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ปุ่มไอคอนพื้นเทา — ใช้ในการจัดการรายการแทนลิงก์ข้อความ */
.icon-btn-muted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F4F4F5;
    color: var(--text-2);
    border: 1px solid transparent;
    cursor: pointer;
}

.icon-btn-muted:hover {
    background: #E4E4E7;
    color: var(--text);
}

/* ----------------------------------------------------------------- badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .55rem;
    font-size: .75rem;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: #15803D;
}

.badge-danger {
    background: var(--danger-bg);
    color: #B91C1C;
}

.badge-brand {
    background: var(--accent-50);
    color: var(--accent-600);
}

.badge-muted {
    background: #F4F4F5;
    color: var(--text-2);
}

/* ------------------------------------------------ switch (สถานะการทำงาน) */

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #D4D4D8;
    transition: background-color .15s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: transform .15s ease;
}

.switch-input:checked + .switch-track {
    background: var(--accent-600);
}

.switch-input:checked + .switch-track::after {
    transform: translateX(16px);
}

.switch-input:focus-visible + .switch-track {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
}

.switch-input:disabled + .switch-track {
    opacity: .55;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------ forms */

.input,
.select,
.textarea {
    width: 100%;
    padding: .5rem .75rem;
    font-size: .875rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.label {
    display: block;
    margin-bottom: .3rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-2);
}

/* ----------------------------------------------------------------- tables */

.table-min {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.table-min thead th {
    text-align: left;
    padding: .6rem .75rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-2);
    background: #fff;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table-min tbody td {
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table-min tbody tr:hover {
    background: #FAFAFA;
}

.table-min tbody tr.is-clickable {
    cursor: pointer;
}

.cell-center {
    text-align: center;
}

/* ---------------------------------------------------------------- forms */

.card-pad {
    padding: 1.25rem 1.35rem;
}

.field-label {
    display: block;
    margin-bottom: .35rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-2);
}

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    padding: .55rem .75rem;
    font-size: .875rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.field-hint {
    margin-top: .3rem;
    font-size: .75rem;
    color: var(--text-3);
}

.field-error {
    margin-top: .3rem;
    font-size: .75rem;
    color: #B91C1C;
}

/* ช่องกรอกที่มีปุ่มท้ายช่อง (เช่น สลับแสดง/ซ่อนรหัสผ่าน) */
.field-wrap {
    position: relative;
}

.field-wrap .field-input {
    padding-right: 2.4rem;
}

.field-toggle {
    position: absolute;
    top: 50%;
    right: .3rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    color: var(--text-3);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.field-toggle:hover {
    color: var(--text-2);
    background: #f4f4f5;
}

.field-toggle svg {
    width: 1rem;
    height: 1rem;
}

/* --------------------------------------------------------- multi-select */

.multiselect {
    position: relative;
}

.multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    padding: .55rem .75rem;
    font-size: .875rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.multiselect-trigger:hover {
    border-color: var(--text-3);
}

.multiselect.is-open .multiselect-trigger {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.multiselect-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiselect-value.is-placeholder {
    color: var(--text-3);
}

.multiselect-caret {
    flex: none;
    color: var(--text-3);
    transition: transform .15s ease;
}

.multiselect.is-open .multiselect-caret {
    transform: rotate(180deg);
}

.multiselect-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 45;
    max-height: 16rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .3rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
    display: none;
}

.multiselect.is-open .multiselect-menu {
    display: block;
    animation: pop .14s ease;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    border-radius: 8px;
    font-size: .85rem;
    color: var(--text);
    cursor: pointer;
}

.multiselect-option:hover {
    background: var(--bg-subtle);
}

.multiselect-option input[type="checkbox"] {
    flex: none;
    accent-color: var(--accent-500);
}

.multiselect-empty {
    padding: .5rem .6rem;
    font-size: .8rem;
    color: var(--text-3);
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-600);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

/* ----------------------------------------------------------------- flash */

.flash {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .7rem .9rem;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: .85rem;
}

.flash-success {
    background: var(--success-bg);
    border-color: #BBF7D0;
    color: #15803D;
}

.flash-error {
    background: var(--danger-bg);
    border-color: #FECDD3;
    color: #B91C1C;
}

.flash-info {
    background: var(--accent-50);
    border-color: #C7D2FE;
    color: var(--accent-600);
}

/* ------------------------------------------------------------- shell/sidebar */

.shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: width .22s ease, transform .24s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.05rem 1.15rem;
    border-bottom: 1px solid var(--border);
    min-height: 68px;
}

.brand-logo {
    flex: 0 0 auto;
    display: block;
    object-fit: contain;
}

.brand-text {
    min-width: 0;
    overflow: hidden;
}

.brand-title {
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.brand-sub {
    font-size: .7rem;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .9rem .7rem 1.4rem;
}

.nav-group + .nav-group {
    margin-top: 1rem;
}

.nav-group-label {
    padding: 0 .6rem .4rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-3);
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .56rem .7rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    transition: background-color .15s ease, color .15s ease;
}

.nav-item + .nav-item {
    margin-top: 2px;
}

.nav-item:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

.nav-item.is-active {
    background: var(--accent-50);
    color: var(--accent-600);
    font-weight: 600;
}

.nav-item svg {
    flex: 0 0 auto;
}

.nav-item .nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: .8rem .9rem;
}

/* ---------------------------------------------------------- main column */

.main-col {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 264px;
    display: flex;
    flex-direction: column;
    transition: margin-left .22s ease;
}

body.sidebar-collapsed .sidebar {
    width: 78px;
}

body.sidebar-collapsed .main-col {
    margin-left: 78px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .nav-item .nav-label,
body.sidebar-collapsed .sidebar-footer .footer-text {
    display: none;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    min-height: 68px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 640px) {
    .topbar {
        padding: .75rem 1.5rem;
    }
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-2);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.icon-btn:hover {
    background: var(--bg-subtle);
    border-color: #C7D2FE;
    color: var(--accent-600);
}

/* ---------------------------------------------------------------- misc */

.avatar {
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-weight: 700;
    color: #fff;
    background: var(--accent-600);
}

.dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    min-width: 224px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .35rem;
    z-index: 50;
    display: none;
}

.dropdown.is-open {
    display: block;
    animation: pop .14s ease;
}

@keyframes pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .6rem;
    border-radius: 8px;
    font-size: .85rem;
    color: var(--text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-subtle);
}

/* --------------------------------------------- dropdown multi select (ms) */

.ms {
    position: relative;
}

.ms-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    text-align: left;
    cursor: pointer;
}

.ms-toggle[disabled] {
    background: var(--bg-subtle);
    color: var(--text-3);
    cursor: not-allowed;
}

.ms-caret {
    flex: none;
    color: var(--text-3);
    transition: transform .15s ease;
}

.ms.is-open .ms-caret {
    transform: rotate(180deg);
}

.ms-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-value.is-placeholder {
    color: var(--text-3);
}

.ms-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + .35rem);
    max-height: 264px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .35rem;
    z-index: 50;
    display: none;
    box-shadow: 0 10px 30px rgba(24, 24, 27, .10);
}

.ms.is-open .ms-menu {
    display: block;
    animation: pop .14s ease;
}

.ms-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .55rem;
    border-radius: 8px;
    font-size: .85rem;
    color: var(--text);
    cursor: pointer;
}

.ms-option:hover {
    background: var(--bg-subtle);
}

.ms-option[hidden] {
    display: none;
}

.ms-option input {
    flex: none;
    width: 15px;
    height: 15px;
    accent-color: var(--accent-600);
}

.ms-empty {
    padding: .75rem .6rem;
    font-size: .82rem;
    color: var(--text-3);
    text-align: center;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 24, 27, .45);
    z-index: 35;
    display: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
}

@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        width: 264px;
    }

    body.drawer-open .sidebar {
        transform: translateX(0);
    }

    body.drawer-open .drawer-overlay {
        display: block;
    }

    .main-col {
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .nav-group-label,
    body.sidebar-collapsed .nav-item .nav-label {
        display: block;
    }

    body.sidebar-collapsed .nav-item,
    body.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
        padding-left: .7rem;
        padding-right: .7rem;
    }
}

@media print {
    .sidebar,
    .topbar,
    .drawer-overlay,
    #toast-host,
    .no-print {
        display: none !important;
    }

    .shell,
    .main-col {
        display: block !important;
        margin-left: 0 !important;
    }
}

/* ------------------------------------------------------ score badge (1-5) */

.score-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: #fff;
    font-size: .8125rem;
    font-weight: 600;
}

.score-1 { background: var(--score-1); }
.score-2 { background: var(--score-2); }
.score-3 { background: var(--score-3); }
.score-4 { background: var(--score-4); }
.score-5 { background: var(--score-5); }

.score-bg-1 { background: var(--score-1); }
.score-bg-2 { background: var(--score-2); }
.score-bg-3 { background: var(--score-3); }
.score-bg-4 { background: var(--score-4); }
.score-bg-5 { background: var(--score-5); }

/* --------------------------------------------------- dashboard / reporting */

.chart-wrap {
    width: 100%;
    overflow-x: auto;
}

.chart-svg {
    display: block;
    width: 100%;
    min-width: 480px;
    height: auto;
}

/* แถวการกระจายคะแนน: ป้ายคะแนน · แถบ · ตัวเลข */
.dist-row {
    display: grid;
    grid-template-columns: 120px 1fr 96px;
    align-items: center;
    gap: .75rem;
}

/* จอเล็กซ่อนชื่อคะแนน จึงเหลือแค่ช่องวงกลมคะแนน */
@media (max-width: 639.98px) {
    .dist-row {
        grid-template-columns: 44px 1fr 96px;
    }
}

/* ------------------------------------------------ อันดับเจ้าหน้าที่ตามคะแนน */

/* การ์ดอันดับสูงสุด 3 อันดับ */
.rank-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface);
}

.rank-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    background: var(--text-2);
}

.rank-badge.rank-1 { background: #D4AF37; }
.rank-badge.rank-2 { background: #A1A1AA; }
.rank-badge.rank-3 { background: #C08457; }

.rank-avatar {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--border);
    font-size: 1.1rem;
}

/* แถบสัดส่วนการกระจายคะแนน 1–5 แบบสะสม */
.stack-bar {
    display: flex;
    height: 10px;
    min-width: 140px;
    border-radius: 999px;
    background: var(--border-light);
    overflow: hidden;
}

.stack-seg {
    display: block;
    height: 100%;
}

.legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.bar-track {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: var(--border-light);
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 999px;
}

/* หัวตารางที่กดเรียงลำดับได้ */
.th-sort {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.th-sort:hover {
    color: var(--accent-600);
}

/* การแบ่งหน้า */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
}

.pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 .5rem;
    font-size: .8125rem;
    color: var(--text-2);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.pager-link:hover {
    border-color: #C7D2FE;
    color: var(--accent-600);
}

.pager-link.is-current {
    background: var(--accent-50);
    border-color: #C7D2FE;
    color: var(--accent-600);
    font-weight: 600;
}

.pager-link.is-disabled {
    opacity: .45;
    pointer-events: none;
}

/* ==========================================================================
   หน้าเข้าสู่ระบบ — ธีมสว่าง (อ้างอิงรูปแบบ Adminator signin · light theme)
   ========================================================================== */

body.auth-page .page-layer > main {
    display: block;
    padding: 0;
}

body.auth-page .page-layer > footer {
    display: none;
}

.auth-shell {
    /* โทเคนสีของหน้า auth (light) แยกขอบเขตไม่ให้กระทบธีมหลักของระบบ */
    --a-bg: #F0F4F8;
    --a-card: #FFFFFF;
    --a-text: #1E293B;
    --a-muted: #64748B;
    --a-light: #94A3B8;
    --a-border: #E4E8EF;
    --a-primary: #2563EB;
    --a-primary-dark: #1D4ED8;
    --a-primary-soft: #EFF6FF;
    --a-primary-ring: rgba(37, 99, 235, .18);
    --a-purple: #8B5CF6;

    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: var(--a-bg);
    color: var(--a-text);
    font-size: 14px;
}

/* ------------------------------------------------------ แบรนด์ด้านซ้าย */

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 40px 48px;
    color: #fff;
    background: linear-gradient(135deg, var(--a-primary), var(--a-purple));
}

.auth-aside::before,
.auth-aside::after {
    content: "";
    position: absolute;
    width: 80%;
    aspect-ratio: 1;
    pointer-events: none;
}

.auth-aside::before {
    inset: -40% -20% auto auto;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 60%);
}

.auth-aside::after {
    inset: auto auto -30% -20%;
    background: radial-gradient(circle, rgba(255, 255, 255, .1), transparent 60%);
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-brand .logo {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.auth-brand .name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.018em;
}

.auth-aside-body {
    position: relative;
    z-index: 1;
    margin-top: auto;
    max-width: 440px;
}

.auth-eyebrow {
    display: block;
    margin-bottom: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.auth-aside-body h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.auth-aside-body p {
    margin: 0 0 24px;
    font-size: 14.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .85);
}

.auth-glass-card {
    margin-top: 32px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.auth-feature-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .9);
}

.auth-feature-list .ico {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.auth-aside-footer {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 18px;
    margin-top: auto;
    padding-top: 24px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .55);
}

/* --------------------------------------------------------- ฝั่งฟอร์ม */

.auth-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 32px 48px;
}

.auth-main-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 700;
    color: var(--a-text);
}

.auth-mobile-brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding: 8px 0;
}

.auth-card h2 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.022em;
    color: var(--a-text);
}

.auth-card .sub {
    margin: 0 0 24px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--a-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--a-text);
}

.auth-input-icon {
    position: relative;
}

.auth-input-icon .ico {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--a-light);
    pointer-events: none;
}

.auth-input-icon .ico svg {
    width: 100%;
    height: 100%;
}

.auth-input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    font-family: inherit;
    font-size: 13px;
    color: var(--a-text);
    background: var(--a-card);
    border: 1px solid var(--a-border);
    border-radius: 8px;
    outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-input::placeholder {
    color: var(--a-light);
}

.auth-input:focus {
    border-color: var(--a-primary);
    box-shadow: 0 0 0 3px var(--a-primary-soft);
}

.auth-input.has-toggle {
    padding-right: 44px;
}

.auth-input-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--a-light);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.auth-input-toggle:hover {
    background: var(--a-bg);
    color: var(--a-muted);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--a-primary);
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: 0 1px 2px var(--a-primary-ring);
    cursor: pointer;
    transition: background-color .18s ease;
}

.auth-submit:hover {
    background: var(--a-primary-dark);
}

.auth-submit svg {
    width: 15px;
    height: 15px;
}

/* ------------------------------------------------------ เครดิตท้ายหน้า */

.auth-main-bottom {
    margin-top: 24px;
    text-align: center;
    font-size: 11.5px;
    color: var(--a-light);
}

/* -------------------------------------------------------- responsive */

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-main {
        padding: 24px 20px;
    }

    .auth-mobile-brand {
        display: inline-flex;
    }
}
