/* Giao diện các trang đăng nhập / quên mật khẩu - đồng bộ với các hệ thống UEB khác */
:root {
    --a-primary: #2f6fd6;
    --a-primary-dark: #2458b3;
    --a-primary-soft: rgba(47, 111, 214, .12);
    --a-brand: #9b1c26;              /* đỏ UEB */
    --a-text: #1e293b;
    --a-muted: #64748b;
    --a-border: #dbe2ea;
    --a-bg-input: #f8fafc;
    --a-error: #c62828;
    --a-error-bg: #fdecec;
    --a-ok: #107c41;
    --a-ok-bg: #e7f6ec;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--a-text);
    background: #eef6fd;
    -webkit-font-smoothing: antialiased;
}

.auth {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 55%, #ffffff 100%);
    overflow: hidden;
}
/* Hai vòng tròn mờ trang trí */
.auth::before, .auth::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: var(--a-primary);
    opacity: .05;
    pointer-events: none;
    animation: auth-float 22s ease-in-out infinite;
}
.auth::before { width: 560px; height: 560px; top: -220px; left: -200px; }
.auth::after  { width: 420px; height: 420px; bottom: -160px; right: -140px; animation-delay: -8s; }
@keyframes auth-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(24px, -24px) scale(1.06); }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 40px 40px 28px;
    background: rgba(255, 255, 255, .96);
    border-radius: 24px;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .04);
    animation: auth-in .45s cubic-bezier(.16, 1, .3, 1);
}
@keyframes auth-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.auth-head { text-align: center; margin-bottom: 28px; }
.auth-logo { width: 76px; height: auto; display: block; margin: 0 auto 18px; }
.auth-head h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
.auth-head p { margin: 0; color: var(--a-muted); font-size: 15px; line-height: 1.5; }

/* Thông báo */
.auth-alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; margin-bottom: 20px;
    border-radius: 12px; font-size: 14px; line-height: 1.45;
}
.auth-alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.auth-alert.is-error { background: var(--a-error-bg); color: var(--a-error); }
.auth-alert.is-ok    { background: var(--a-ok-bg); color: var(--a-ok); }
.auth-alert.is-info  { background: var(--a-primary-soft); color: var(--a-primary-dark); }
.auth-alert a { color: inherit; font-weight: 600; }

/* Ô nhập */
.auth-field { margin-bottom: 18px; }
.auth-field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.auth-field label .req { color: var(--a-error); margin-left: 2px; }
.auth-input-wrap { position: relative; }
.auth-input {
    display: block; width: 100%; height: 48px;
    padding: 0 14px;
    font: inherit; font-size: 16px;               /* >= 16px: iPhone không tự phóng to */
    color: var(--a-text);
    background: var(--a-bg-input);
    border: 1.5px solid var(--a-border);
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s, background .15s;
    -webkit-appearance: none; appearance: none;
}
.auth-input::placeholder { color: #94a3b8; }
.auth-input:hover { border-color: #b8c6d8; }
.auth-input:focus { outline: none; background: #fff; border-color: var(--a-primary); box-shadow: 0 0 0 4px var(--a-primary-soft); }
.auth-input.has-toggle { padding-right: 52px; }
.auth-hint { margin: 6px 0 0; font-size: 13px; color: var(--a-muted); }

.auth-toggle {
    position: absolute; top: 0; right: 0;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 0; border-radius: 0 12px 12px 0;
    color: var(--a-muted); cursor: pointer;
}
.auth-toggle:hover, .auth-toggle:focus-visible { color: var(--a-primary); outline: none; }
.auth-toggle svg { width: 20px; height: 20px; }
.auth-toggle .eye-off { display: none; }
.auth-toggle[aria-pressed="true"] .eye { display: none; }
.auth-toggle[aria-pressed="true"] .eye-off { display: block; }

/* Nút */
.auth-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 50px; margin-top: 8px;
    font: inherit; font-size: 16px; font-weight: 600;
    color: #fff; background: var(--a-primary);
    border: 0; border-radius: 12px; cursor: pointer;
    box-shadow: 0 6px 16px -6px rgba(47, 111, 214, .55);
    transition: background .15s, transform .05s, box-shadow .15s;
    text-decoration: none;
}
.auth-btn:hover { background: var(--a-primary-dark); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--a-primary-soft); }
.auth-btn[disabled] { opacity: .75; cursor: progress; }
.auth-btn svg { width: 20px; height: 20px; }
.auth-btn .spin { display: none; animation: auth-spin .8s linear infinite; }
.auth-btn.is-loading .spin { display: block; }
.auth-btn.is-loading .ico { display: none; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-btn.is-ghost { background: #fff; color: var(--a-primary); border: 1.5px solid var(--a-border); box-shadow: none; }
.auth-btn.is-ghost:hover { background: var(--a-bg-input); }

/* Chân thẻ */
.auth-divider { height: 1px; background: var(--a-border); margin: 26px 0 18px; border: 0; }
.auth-links { text-align: center; font-size: 14px; color: var(--a-muted); line-height: 1.7; }
.auth-links a { color: var(--a-primary); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }
.auth-links .sep { margin: 0 8px; color: var(--a-border); }
.auth-note { margin-top: 10px; font-size: 13px; color: var(--a-muted); text-align: center; line-height: 1.5; }
.auth-note svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; color: var(--a-primary); }

.auth-foot {
    position: relative; z-index: 1;
    margin-top: 22px; text-align: center;
    font-size: 12.5px; color: var(--a-muted); line-height: 1.6;
}
.auth-foot b { color: var(--a-brand); font-weight: 600; }

/* Trang thông báo (thành công / lỗi) */
.auth-status { width: 64px; height: 64px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.auth-status svg { width: 32px; height: 32px; }
.auth-status.is-ok { background: var(--a-ok-bg); color: var(--a-ok); }
.auth-status.is-info { background: var(--a-primary-soft); color: var(--a-primary); }
.auth-status.is-error { background: var(--a-error-bg); color: var(--a-error); }

/* Điện thoại */
@media (max-width: 480px) {
    .auth { justify-content: flex-start; padding: 20px 12px 16px; }
    .auth-card { padding: 28px 20px 22px; border-radius: 20px; }
    .auth-logo { width: 64px; margin-bottom: 14px; }
    .auth-head { margin-bottom: 22px; }
    .auth-head h1 { font-size: 22px; }
    .auth-head p { font-size: 14px; }
}
/* Màn hình thấp (điện thoại xoay ngang) */
@media (max-height: 560px) {
    .auth { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .auth::before, .auth::after, .auth-card { animation: none; }
}

/* Hướng dẫn phân biệt tài khoản */
[hidden] { display: none !important; }
.auth-guide summary {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--a-primary);
    padding: 6px 0; border-radius: 8px;
}
.auth-guide summary::-webkit-details-marker { display: none; }
.auth-guide summary::after { content: "▾"; font-size: 12px; transition: transform .15s; }
.auth-guide[open] summary::after { transform: rotate(180deg); }
.auth-guide summary svg { width: 16px; height: 16px; }
.auth-guide summary:focus-visible { outline: 2px solid var(--a-primary); outline-offset: 2px; }
.auth-compare { display: grid; gap: 12px; margin-top: 14px; }
.auth-type { border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; border: 1.5px solid var(--a-border); }
.auth-type.is-ueb { background: #f3f8ff; border-color: #cfe0fb; }
.auth-type.is-vnu { background: #fff; }
.auth-type h3 { margin: 0 0 6px; font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.auth-type h3 span { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.auth-type.is-ueb h3 span { background: var(--a-primary); color: #fff; }
.auth-type.is-vnu h3 span { background: #eef1f5; color: var(--a-muted); }
.auth-type ul { margin: 0; padding-left: 18px; color: #475569; }
.auth-type li { margin: 2px 0; }
.auth-type code { font-size: 12.5px; background: rgba(15, 23, 42, .06); padding: 1px 5px; border-radius: 5px; color: var(--a-text); white-space: nowrap; }
.auth-type .auth-btn { height: 42px; margin-top: 12px; font-size: 14px; }

/* ===== Trang nội dung (Hướng dẫn, Lỗi thường gặp) ===== */
.auth-card.is-wide { max-width: 820px; padding: 36px 40px 28px; }
.auth-card.is-wide .auth-head { margin-bottom: 20px; }
.auth-footnav { margin-bottom: 8px; }
.auth-footnav a { color: var(--a-primary); text-decoration: none; font-weight: 600; }
.auth-footnav span { margin: 0 8px; color: #b6c2d1; }
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; justify-content: center; }
.help-toc a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--a-primary-soft); color: var(--a-primary-dark); font-size: 13px; font-weight: 600; text-decoration: none; }
.help-toc a:hover { background: rgba(47,111,214,.2); }
.help h2 { font-size: 19px; margin: 30px 0 10px; padding-top: 6px; scroll-margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.help h2 .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--a-primary); color: #fff; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.help h3 { font-size: 15.5px; margin: 18px 0 6px; }
.help p, .help li { font-size: 15px; line-height: 1.65; color: #334155; }
.help ul, .help ol { padding-left: 22px; margin: 6px 0 12px; }
.help li { margin: 3px 0; }
.help a { color: var(--a-primary); font-weight: 600; }
.help code, .help kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: #eef2f7; padding: 1px 6px; border-radius: 5px; color: var(--a-text); white-space: nowrap; }
.help .path { font-weight: 600; color: var(--a-text); }
.help-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0 14px; font-size: 14px; border: 1px solid var(--a-border); border-radius: 12px; overflow: hidden; }
.help-table th, .help-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--a-border); line-height: 1.5; }
.help-table tr:last-child td { border-bottom: 0; }
.help-table th { background: #f3f7fc; font-weight: 700; font-size: 13px; color: #475569; }
.help-ssid { font-weight: 700; color: var(--a-primary-dark); white-space: nowrap; }
.help-box { border-radius: 12px; padding: 12px 16px; margin: 12px 0; font-size: 14.5px; line-height: 1.6; }
.help-box.is-warn { background: #fff8e6; border: 1px solid #f5d98b; color: #6b4a00; }
.help-box.is-info { background: #eef5ff; border: 1px solid #cfe0fb; color: #1e4b8f; }
.help-box.is-ok { background: var(--a-ok-bg); border: 1px solid #b7e4c7; color: #0f5132; }
.help-steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.help-steps > li { counter-increment: s; position: relative; padding-left: 38px; margin: 10px 0; }
.help-steps > li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: #e8f0fd; color: var(--a-primary-dark); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
/* Hỏi - đáp dạng thu gọn */
.faq { border: 1px solid var(--a-border); border-radius: 14px; margin: 10px 0; background: #fff; }
.faq > summary { list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 700; font-size: 15.5px; position: relative; line-height: 1.45; }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 400; color: var(--a-primary); }
.faq[open] > summary::after { content: "−"; }
.faq[open] > summary { border-bottom: 1px solid var(--a-border); }
.faq > summary:focus-visible { outline: 2px solid var(--a-primary); outline-offset: 2px; border-radius: 14px; }
.faq .faq-body { padding: 6px 16px 14px; }
.faq .tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-right: 6px; vertical-align: 2px; }
.faq .tag.wifi { background: #e8f0fd; color: var(--a-primary-dark); }
.faq .tag.acc { background: #fdecef; color: #9b1c26; }
.os-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 0; }
.os { border: 1px solid var(--a-border); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.os > b { display: block; font-size: 13.5px; margin-bottom: 2px; color: var(--a-text); }
.os span { font-size: 13.5px; color: #475569; line-height: 1.55; }
.help-src { font-size: 12.5px; color: var(--a-muted); margin-top: 26px; line-height: 1.6; }
.help-src a { font-weight: 400; }
@media (max-width: 640px) {
    .auth-card.is-wide { padding: 24px 16px 20px; }
    .os-tabs { grid-template-columns: 1fr; }
    .help-table { font-size: 13px; }
    .help-table th, .help-table td { padding: 8px; }
    .help-table.stack thead { display: none; }
    .help-table.stack tr { display: block; border-bottom: 1px solid var(--a-border); }
    .help-table.stack td { display: block; border: 0; padding: 4px 10px; }
    .help-table.stack td:first-child { padding-top: 10px; }
    .help-table.stack tr:last-child { border-bottom: 0; }
}
@media (max-width: 640px) {
    .help-table.stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 700; color: var(--a-primary-dark); }
    .help-table.stack td:first-child { font-weight: 700; background: #f3f7fc; }
}
