/* ============================================================================
   login.css — Trang đăng nhập /Login/Login (Views/Login/Login.cshtml, Layout = null)

   Dựng theo mẫu "dang-nhap hieu ung.html" (user gửi 17/09/2026): nền canvas 4 hiệu ứng,
   khối logo công ty bên trái, thẻ đăng nhập bên phải; màn hẹp (≤ 860px) xếp dọc.
   Trang KHÔNG dùng theme smartadminNew / Bootstrap ⇒ mọi style tự chứa trong file này.
   Chỉ dùng font hệ thống ⇒ không phụ thuộc tài nguyên mạng ngoài.

   Khác mẫu (có chủ ý):
   - Mẫu khoá cuộn (body overflow:hidden) và để .stage tự cuộn bên trong, nhưng .stage có
     pointer-events:none ⇒ lăn chuột / vuốt trên nền KHÔNG cuộn được khi màn thấp. Ở đây để
     TÀI LIỆU cuộn (canvas position:fixed nên không gây tràn), chỉ cắt tràn ngang của quầng
     sáng sau logo.
   - Thêm style cho thông báo kiểm tra của máy chủ (khi trình duyệt tắt JS) và nút "Quên mật
     khẩu?" dạng nút (không dùng <a href="#">).
   - Màu CHỮ đậm hơn mẫu vừa đủ đạt WCAG 2.2 AA (review 17/09/2026, tính lại trên MỌI nền thật của trang:
     trắng, #F7FBF8, #F4FBF6, #E1F5E8, #D3F0DD). Mẫu gốc: chữ xanh #1E8E4E chỉ 4,17:1 trên trắng, chữ trắng
     trên nút #34BE6A chỉ 2,41:1, viền focus #2FB463 chỉ 2,57:1, placeholder 2,15:1. Giữ nguyên sắc độ.
     --green (#2FB463) chỉ còn dùng cho chi tiết TRANG TRÍ (viền trên thẻ, chấm, bóng), không cho chữ/viền focus.
   ============================================================================ */

:root {
    --bg: #F4FBF6;
    --bg-2: #D3F0DD;
    --panel: rgba(255, 255, 255, .95);
    --line: rgba(30, 120, 70, .14);
    --green: #2FB463;
    --green-dark: #197842;      /* chữ xanh + viền focus: ≥4,54:1 trên mọi nền (mẫu #1E8E4E = 4,17:1) */
    --navy: #0B3A6E;
    --warn: #E0A12E;
    --text: #12352A;
    --muted: #536F5F;           /* chữ phụ: ≥4,54:1 trên mọi nền (mẫu #5B7A68 = 4,51:1 trên #F4FBF6) */
    --danger: #C0392B;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    background:
        radial-gradient(ellipse at 50% 0%, var(--bg-2) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, #E1F5E8 0%, transparent 50%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    overflow-x: hidden;
}

#bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* ---------- Bố cục: logo công ty bên trái, thẻ đăng nhập bên phải ---------- */
.stage {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: clamp(24px, 5vw, 80px);
    padding: 32px clamp(24px, 7vw, 110px) 72px;
    pointer-events: none;          /* chuột "xuyên" xuống nền canvas */
    overflow-x: hidden;            /* quầng sáng sau logo không tạo thanh cuộn ngang */
    overflow-x: clip;
}

.company {
    pointer-events: auto;
    justify-self: start;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 14px;
    max-width: 520px;
    padding: 12px 0;
    position: relative;
    isolation: isolate;
}

/* Quầng trắng mềm sau logo để chữ luôn dễ đọc trên nền hiệu ứng */
.company::before {
    content: "";
    position: absolute;
    inset: -90px -120px;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .94) 55%, rgba(255, 255, 255, 0) 100%);
}

.company-name, .company-sub, .company-support { text-shadow: 0 0 6px #fff, 0 0 12px #fff; }

.company-logo {
    display: grid;
    place-items: center;
    width: 156px;
    height: 156px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 6px rgba(47, 180, 99, .16), 0 12px 30px -10px rgba(20, 90, 50, .35);
}

.company-logo picture { display: contents; }

.company-logo img {
    display: block;
    width: 132px;
    height: 132px;
    object-fit: contain;
}

.company-name {
    margin: 8px 0 0;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--navy);
}

.company-sub {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--muted);
}

.company-support {
    margin: 0;
    font-size: .88rem;
    line-height: 1.5;
    color: #2E4D3C;
}

.company-support a { font-weight: 600; }

/* ---------- Thẻ đăng nhập ---------- */
.card-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.card {
    pointer-events: auto;
    width: min(400px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 4px solid var(--green);
    border-radius: 20px;
    padding: 30px 32px 22px;
    box-shadow: 0 30px 70px -30px rgba(20, 90, 50, .3), 0 2px 6px rgba(20, 90, 50, .06);
}

.card h1 {
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    line-height: 1.15;
}

.card .sub {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.5;
}

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: .9rem;
    margin-bottom: 7px;
    color: #2E4D3C;
    font-weight: 500;
}

.input-wrap { position: relative; }

.login-input {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: #F7FBF8;
    border: 1px solid rgba(30, 120, 70, .25);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.login-input::placeholder { color: #64786D; }   /* 4,52:1 (mẫu #9AB3A4 = 2,15:1) */

.login-input:focus {
    border-color: var(--green-dark);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(25, 120, 66, .25);
}

.login-input[aria-invalid="true"],
.login-input.input-validation-error { border-color: var(--danger); }

.has-toggle .login-input { padding-right: 64px; }

.toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--green-dark);
    font: inherit;
    font-size: .85rem;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
}

.toggle:hover { background: rgba(47, 180, 99, .1); }

/* Thông báo kiểm tra của máy chủ (chỉ hiện khi trình duyệt không chạy JS) */
.validation {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-size: .82rem;
}

.validation.field-validation-valid { display: none; }

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 4px 0 22px;
    font-size: .9rem;
    flex-wrap: wrap;
}

.check {
    display: flex;
    align-items: center;
    min-height: 24px;           /* vùng bấm ≥24px (WCAG 2.5.8) */
    gap: 8px;
    color: #2E4D3C;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

.check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--green-dark);   /* ô đã tick: 5,5:1 (WCAG 1.4.11 cần ≥3:1; #2FB463 chỉ 2,68:1) */
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.link-btn {
    display: inline-flex;
    align-items: center;
    min-height: 24px;           /* vùng bấm ≥24px (WCAG 2.5.8) */
    background: none;
    border: 0;
    padding: 2px 0;
    font: inherit;
    color: var(--green-dark);
    cursor: pointer;
}

.link-btn:hover { text-decoration: underline; }

.submit {
    width: 100%;
    padding: 13px;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #21874B, #176F3F);   /* chữ trắng 4,53–6,21:1 (mẫu 2,41–4,17:1) */
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 16px -6px rgba(30, 142, 78, .55);
    transition: transform .08s, filter .15s;
}

.submit:hover { filter: brightness(.94); }   /* tối đi khi rê chuột — sáng lên là tụt tương phản chữ */
.submit:active { transform: translateY(1px); }
.submit[disabled] { opacity: .7; cursor: progress; }

.msg {
    min-height: 1.4em;
    margin: 12px 0 0;
    font-size: .9rem;
    line-height: 1.4;
}

.msg.err { color: var(--danger); font-weight: 500; }
.msg.ok { color: var(--green-dark); }
.msg.info { color: #2E4D3C; }

.foot {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .82rem;
}

.dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(47, 180, 99, .2);
}

.dot.off {
    background: var(--warn);
    box-shadow: 0 0 0 3px rgba(224, 161, 46, .2);
}

/* ---------- Bộ chọn hiệu ứng nền ---------- */
.fx {
    position: fixed;
    z-index: 2;
    left: 18px;
    bottom: 18px;
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 4px 14px -6px rgba(20, 90, 50, .2);
}

.fx button {
    font: inherit;
    font-size: .85rem;
    color: var(--muted);
    background: none;
    border: 0;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.fx button:hover { color: var(--text); }

.fx button[aria-pressed="true"] {
    background: #DDF3E5;
    color: #146B3A;
    font-weight: 600;
}

.hint {
    position: fixed;
    z-index: 2;
    left: 22px;
    bottom: 66px;
    color: var(--muted);
    font-size: .8rem;
    pointer-events: none;
}

:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }   /* ≥4,5:1 (WCAG 2.4.11) */

/* ---------- Màn hẹp: xếp dọc, logo trên - thẻ dưới ---------- */
@media (max-width: 860px) {
    .stage {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        align-content: start;
        gap: 12px;
        padding: 20px 20px 24px;
    }

    .company { justify-self: center; align-items: center; text-align: center; }
    .company::before { inset: -40px -60px; }
    .company-logo { width: 96px; height: 96px; }
    .company-logo img { width: 80px; height: 80px; }
    .company-name { font-size: 1.35rem; margin-top: 2px; }
    .company-sub { font-size: .92rem; }
    .company-support { font-size: .82rem; }
    .card-area { justify-content: center; }
}

/* Màn hẹp HOẶC thấp: thanh chọn hiệu ứng KHÔNG cố định nữa mà nằm cuối trang.
   Mẫu gốc để nó position:fixed ở mọi cỡ ⇒ đo thật 812×375 (điện thoại xoay ngang) thanh nút
   ĐÈ LÊN ô nhập tên đăng nhập; 375×812 thì che dòng trạng thái mạng của thẻ. */
@media (max-width: 860px), (max-height: 600px) {
    .fx {
        position: relative;
        left: auto;
        bottom: auto;
        width: max-content;
        max-width: calc(100% - 24px);
        margin: 0 auto 16px;
    }

    .hint { display: none; }
}

@media (max-width: 640px) {
    .card { padding: 24px 20px 18px; }
    .fx { width: auto; margin: 0 12px 12px; flex-wrap: wrap; }
    .fx button { flex: 1 1 auto; padding: 7px 8px; }   /* 5 nút: xuống dòng thì giãn đều lấp kín hàng */
}

@media (max-height: 600px) and (max-width: 860px) {
    .company-logo { width: 64px; height: 64px; }
    .company-logo img { width: 54px; height: 54px; }
    .company-sub, .company-support { display: none; }
}
