* {
    box-sizing: border-box;
}

:root {
    --bg: #060811;
    --panel: rgba(9, 13, 27, 0.88);
    --panel-solid: #0b1020;
    --panel-soft: rgba(15, 23, 42, 0.72);
    --gold: #f2c94c;
    --gold-2: #ffb22e;
    --gold-dark: #8a6614;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(242, 201, 76, 0.22);
    --line-strong: rgba(242, 201, 76, 0.45);
    --red: #ff5964;
    --red-bg: rgba(121, 23, 34, 0.28);
    --green: #55e38f;
    --green-bg: rgba(18, 110, 57, 0.25);
    --shadow: 0 30px 90px rgba(0,0,0,.55);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 12%, rgba(72, 100, 255, .18), transparent 28%),
        radial-gradient(circle at 90% 20%, rgba(242, 201, 76, .16), transparent 26%),
        linear-gradient(135deg, #05070d 0%, #080c18 48%, #03050a 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 75%);
}

a {
    color: inherit;
}

.auth-page,
.admin-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    overflow: hidden;
}

.bg-orb {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    filter: blur(70px);
    opacity: .36;
    pointer-events: none;
}

.orb-1 {
    top: -90px;
    left: -80px;
    background: #355cff;
}

.orb-2 {
    right: -110px;
    bottom: -110px;
    background: #ffb22e;
}

.auth-wrap {
    position: relative;
    z-index: 1;
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, .82), rgba(2, 6, 23, .92));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.promo-panel {
    position: relative;
    min-height: 650px;
    padding: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 178, 46, .20), transparent 27%),
        linear-gradient(135deg, rgba(16, 22, 42, .94), rgba(9, 13, 25, .74));
}

.promo-panel::before {
    content: "MU";
    position: absolute;
    right: -40px;
    bottom: -90px;
    font-size: 250px;
    line-height: .8;
    font-weight: 900;
    color: rgba(255,255,255,.035);
    letter-spacing: -18px;
}

.promo-badge,
.eyebrow {
    width: max-content;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(242, 201, 76, .30);
    border-radius: 999px;
    color: #ffe9a4;
    background: rgba(242, 201, 76, .08);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.eyebrow {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gold);
    font-size: 11px;
    margin-bottom: 6px;
}

.eyebrow.center {
    margin-left: auto;
    margin-right: auto;
}

.promo-panel h1 {
    position: relative;
    margin: 22px 0 16px;
    max-width: 520px;
    font-size: clamp(38px, 5vw, 66px);
    line-height: 1.02;
    letter-spacing: -2px;
}

.promo-panel h1 span {
    color: var(--gold);
    text-shadow: 0 0 28px rgba(242, 201, 76, .23);
}

.promo-desc {
    position: relative;
    max-width: 480px;
    margin: 0;
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.7;
}

.feature-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 32px 0 22px;
}

.feature-card {
    min-height: 108px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(3, 7, 18, .46);
}

.feature-card strong {
    display: block;
    color: var(--gold);
    font-size: 24px;
    margin-bottom: 10px;
}

.feature-card span {
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 700;
}

.promo-warning {
    position: relative;
    width: fit-content;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 89, 100, .26);
    background: rgba(121, 23, 34, .18);
    color: #ffd6da;
    font-size: 14px;
    line-height: 1.5;
}

.form-panel {
    padding: 34px;
    background: rgba(2, 6, 23, .60);
    border-left: 1px solid rgba(255,255,255,.06);
}

.form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    color: #fff2b5;
    background: rgba(3, 7, 18, 0.56);
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    transition: .18s ease;
}

.back-btn:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
}

.form-head h2 {
    margin: 0;
    text-align: right;
    font-size: 27px;
    letter-spacing: -.6px;
}

.register-form {
    display: grid;
    gap: 13px;
}

.field {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 62px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .20);
    background: rgba(5, 10, 24, .84);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field:focus-within {
    border-color: rgba(242, 201, 76, .66);
    box-shadow: 0 0 0 4px rgba(242, 201, 76, .08);
    background: rgba(5, 10, 24, .96);
}

.field-icon {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(242, 201, 76, .10);
    border: 1px solid rgba(242, 201, 76, .16);
    font-size: 16px;
}

.field-body {
    flex: 1;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.field-body small {
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.25;
    font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
}

.field input {
    width: 100%;
    height: 28px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
}

.field input::placeholder {
    color: #8b95aa;
    font-weight: 500;
}

.captcha-line {
    display: grid;
    grid-template-columns: 1fr 138px;
    gap: 12px;
}

.captcha-card {
    min-height: 62px;
    display: grid;
    place-items: center;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(242, 201, 76, .30);
    background:
        radial-gradient(circle at 30% 20%, rgba(242, 201, 76, .18), transparent 35%),
        rgba(5, 10, 24, .84);
}

.captcha-code {
    color: #ffe680;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: 5px;
    line-height: 1;
    text-shadow: 0 0 18px rgba(242, 201, 76, .28);
    user-select: none;
}

.captcha-card a {
    color: #cbd5e1;
    font-size: 12px;
    text-decoration: none;
    margin-top: -2px;
}

.security-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 89, 100, .42);
    background: var(--red-bg);
    color: #ffd2d6;
}

.security-note span {
    color: var(--red);
    font-weight: 900;
}

.security-note p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.submit-btn {
    height: 54px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffe27a, #ffb22e 58%, #e1981c);
    color: #10131d;
    font-weight: 950;
    font-size: 16px;
    letter-spacing: .5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 18px 32px rgba(255, 178, 46, .20);
    transition: transform .18s ease, filter .18s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.notice {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 13px 14px;
    border-radius: 16px;
    line-height: 1.45;
    font-size: 14px;
}

.notice.success {
    background: var(--green-bg);
    border: 1px solid rgba(85, 227, 143, .28);
    color: #d7ffe5;
}

.notice.error {
    background: var(--red-bg);
    border: 1px solid rgba(255, 89, 100, .30);
    color: #ffd2d6;
}

.form-footer {
    display: grid;
    gap: 6px;
    margin-top: 17px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.form-footer a {
    color: #f6db82;
    text-decoration: none;
    font-weight: 700;
}

.hp-field {
    display: none !important;
}

/* Fix trình duyệt tự lưu/autofill làm input bị nền trắng */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(5, 10, 24, 0.98) inset !important;
    box-shadow: 0 0 0 1000px rgba(5, 10, 24, 0.98) inset !important;
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc !important;
    transition: background-color 9999s ease-in-out 0s !important;
}

/* Admin */
.admin-login {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(9, 13, 27, .88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    text-align: center;
}

.login-logo {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 22px;
    color: #111827;
    background: linear-gradient(135deg, #ffe27a, #ffb22e);
    font-weight: 950;
    font-size: 22px;
}

.admin-login h1,
.dashboard h1 {
    margin: 0 0 8px;
    font-size: 30px;
    letter-spacing: -.6px;
}

.admin-login p,
.dashboard p {
    margin: 0 0 20px;
    color: #cbd5e1;
}

.dashboard {
    position: relative;
    z-index: 1;
    width: min(1240px, 100%);
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(9, 13, 27, .88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.dash-stats {
    display: flex;
    gap: 12px;
}

.stat-card {
    min-width: 160px;
    padding: 15px 18px;
    border: 1px solid rgba(242, 201, 76, .22);
    border-radius: 18px;
    background: rgba(5, 10, 24, .62);
}

.stat-card span {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 4px;
}

.stat-card strong {
    color: var(--gold);
    font-size: 28px;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.admin-search {
    display: grid;
    grid-template-columns: 1fr 135px auto;
    gap: 10px;
}

.admin-search input {
    height: 48px;
    border: 1px solid rgba(148, 163, 184, .20);
    border-radius: 15px;
    background: rgba(5, 10, 24, .84);
    color: #fff;
    padding: 0 15px;
    outline: none;
    font-size: 15px;
}

.admin-search input:focus {
    border-color: rgba(242, 201, 76, .66);
    box-shadow: 0 0 0 4px rgba(242, 201, 76, .08);
}

.admin-search button,
.admin-search a,
.action-buttons a {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 15px;
    border: 1px solid rgba(242, 201, 76, .22);
    text-decoration: none;
    font-weight: 850;
    font-size: 14px;
}

.admin-search button {
    border: 0;
    color: #111827;
    background: linear-gradient(135deg, #ffe27a, #ffb22e);
    cursor: pointer;
}

.admin-search a,
.action-buttons a {
    color: #ffe9a4;
    background: rgba(5, 10, 24, .74);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-buttons .danger-link {
    color: #ffd2d6;
    border-color: rgba(255, 89, 100, .30);
    background: rgba(121, 23, 34, .18);
}

.table-card {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .14);
    background: rgba(5, 10, 24, .55);
}

table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 13px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    text-align: left;
    white-space: nowrap;
    font-size: 14px;
}

th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #111827;
    color: #ffe9a4;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .35px;
}

td {
    color: #e5e7eb;
}

tbody tr:hover td {
    background: rgba(242, 201, 76, .045);
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 30px;
}

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

    .promo-panel {
        min-height: auto;
        padding: 30px;
    }

    .promo-panel h1 {
        font-size: 38px;
    }

    .form-panel {
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.06);
    }

    .dashboard-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .auth-page,
    .admin-page {
        padding: 16px 10px;
    }

    .auth-wrap,
    .dashboard,
    .admin-login {
        border-radius: 22px;
    }

    .promo-panel {
        display: none;
    }

    .form-panel {
        padding: 20px 14px;
    }

    .form-head {
        align-items: flex-start;
    }

    .form-head h2 {
        font-size: 22px;
    }

    .back-btn {
        min-width: 94px;
        height: 38px;
        padding: 0 12px;
        font-size: 13px;
    }

    .field {
        min-height: 58px;
        border-radius: 14px;
    }

    .captcha-line,
    .admin-search {
        grid-template-columns: 1fr;
    }

    .captcha-card {
        min-height: 58px;
    }

    .dashboard {
        padding: 16px;
    }

    .dashboard-head {
        display: grid;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons a {
        flex: 1;
    }
}

@media (max-width: 420px) {
    .form-head h2 {
        font-size: 20px;
    }

    .eyebrow {
        font-size: 10px;
    }

    .field-icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .field input {
        font-size: 14px;
    }
}


/* Fix font tiếng Việt form đăng ký */
.form-panel,
.register-form,
.field,
.field input,
.field-body small,
.security-note,
.submit-btn {
    font-family: "Segoe UI", Tahoma, Arial, Helvetica, sans-serif;
}

.form-panel {
    font-feature-settings: "kern";
}

.field-body small,
.field input,
.security-note p {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
