/* ════════════════════════════════════════════════════════════════
   LOGIN — "tờ hoá đơn" / thermal receipt
   Nạp SAU cream-theme.css trong App.razor.

   Toàn bộ selector mang tiền tố .lg- nên không đụng và không bị đụng
   bởi app.css (.login-card, .neural-*) lẫn cream-theme.css. Các rule
   login cũ trong app.css vì thế nằm im, không cần gỡ vội.

   Bảng màu: giữ nguyên token mist-slate của app (không thêm accent
   thứ hai). Bo góc: 0 ở MỌI thứ — giấy in không bo góc, và đó chính
   là điểm nhận dạng của màn này.
   ════════════════════════════════════════════════════════════════ */

.lg-page {
    --lg-ink: #0f172a;
    --lg-body: #1e293b;
    --lg-muted: #475569;
    --lg-soft: #64748b;
    --lg-line: rgba(30, 41, 59, .16);
    --lg-line-strong: rgba(30, 41, 59, .32);
    --lg-paper: #fcfbf8; /* giấy: ấm hơn nền lạnh một chút để nổi lên như vật thể */
    --lg-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    position: relative;
    z-index: 1;
    min-height: 100dvh;
    overflow-x: clip; /* tờ giấy xoay nghiêng không được đẻ ra thanh cuộn ngang */
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: clamp(2rem, 6vw, 5.5rem);
    max-width: 1320px;
    margin-inline: auto;
    padding: clamp(2rem, 5vh, 4rem) clamp(1.5rem, 6vw, 5rem);
    color: var(--lg-body);
}

/* ───────────────── Cột trái: lời tuyên bố ───────────────── */

.lg-say {
    max-width: 32ch;
}

.lg-headline {
    margin: 0;
    font-size: clamp(2.1rem, 4.6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -.032em;
    color: var(--lg-ink);
    text-wrap: balance;
}

.lg-sub {
    margin: 1.15rem 0 0;
    font-size: clamp(.95rem, 1.1vw, 1.05rem);
    line-height: 1.65;
    color: var(--lg-muted);
    max-width: 30ch;
}

/* Gạch chân mảnh dưới câu tuyên bố — neo cột trái vào nền, không phải
   trang trí kẻ ô. */
.lg-rule {
    width: 3.5rem;
    height: 2px;
    margin-top: 2rem;
    background: var(--lg-ink);
    opacity: .8;
}

/* ───────────────── Cột phải: tờ hoá đơn ───────────────── */

/* Bóng đổ đặt ở WRAPPER: filter chạy trước mask trong thứ tự render,
   nên nếu để chung một thẻ thì mask sẽ xén mất bóng. Tách ra thì bóng
   ôm đúng đường răng cưa. */
.lg-slip-wrap {
    justify-self: end;
    width: 100%;
    max-width: 358px;
    filter: drop-shadow(0 20px 44px rgba(15, 23, 42, .16)) drop-shadow(0 2px 4px rgba(15, 23, 42, .10));
    transform: rotate(-1.15deg);
    transform-origin: 50% 30%;
    transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}

/* Chạm/focus vào là tờ giấy thẳng lại — phản hồi "cầm tờ bill lên",
   không phải hiệu ứng cho vui. */
.lg-slip-wrap:hover,
.lg-slip-wrap:focus-within {
    transform: rotate(0deg);
}

.lg-slip {
    background-color: var(--lg-paper);
    /* thớ giấy: sọc ngang cực nhạt, không dùng ảnh */
    background-image:
        repeating-linear-gradient(0deg, rgba(30,41,59,.022) 0 1px, transparent 1px 3px),
        radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.9) 0%, transparent 70%);
    padding: 2.25rem 1.75rem 1.1rem;
    /* Mép dưới xé răng cưa: lớp radial khoét nửa vòng tròn ở dải đáy,
       lớp linear giữ nguyên phần thân. Hai lớp mask hợp nhau. */
    -webkit-mask:
        radial-gradient(8px at 8px 100%, #0000 98%, #000 100%) 0 100%/16px 16px repeat-x,
        linear-gradient(#000 0 0) 0 0/100% calc(100% - 8px) no-repeat;
    mask:
        radial-gradient(8px at 8px 100%, #0000 98%, #000 100%) 0 100%/16px 16px repeat-x,
        linear-gradient(#000 0 0) 0 0/100% calc(100% - 8px) no-repeat;
}

.lg-mark {
    margin: 0;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: .34em;
    text-indent: .34em; /* bù tracking để chữ vẫn cân giữa */
    color: var(--lg-ink);
}

.lg-kicker {
    margin: .45rem 0 0;
    text-align: center;
    font-family: var(--lg-mono);
    font-size: 10.5px;
    letter-spacing: .2em;
    color: var(--lg-soft);
}

.lg-tear {
    height: 1px;
    margin: 1.35rem 0;
    background-image: linear-gradient(90deg, var(--lg-line) 0 5px, transparent 5px 10px);
    background-size: 10px 1px;
}

/* Dòng dữ liệu kiểu bill: nhãn trái, leader chấm, giá trị phải */
.lg-line {
    display: flex;
    align-items: baseline;
    font-family: var(--lg-mono);
    font-size: 11.5px;
    letter-spacing: .06em;
    color: var(--lg-muted);
}

.lg-line + .lg-line { margin-top: .6rem; }

.lg-line i {
    flex: 1;
    height: 0;
    margin: 0 .5rem;
    border-bottom: 1px dotted var(--lg-line);
    transform: translateY(-.22em);
}

.lg-line b {
    font-weight: 600;
    color: var(--lg-ink);
}

/* ───────────────── Nút đăng nhập ───────────────── */

.lg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: 100%;
    min-height: 50px;
    padding: 0 1rem;
    background: var(--lg-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .18s ease, transform .12s ease;
}

.lg-btn:hover,
.lg-btn:focus-visible {
    background: #1e293b;
    color: #fff;
    text-decoration: none;
}

.lg-btn:active { transform: translateY(1px); }

/* Ô trắng đựng logo G: vừa đúng hướng dẫn nhận diện của Google, vừa
   trông như con dấu đóng trên tờ bill. */
.lg-btn .lg-g {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    background: #fff;
    flex: none;
}

.lg-alt {
    margin: .95rem 0 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--lg-soft);
}

.lg-alt-link {
    color: var(--lg-ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--lg-line-strong);
    padding-bottom: 1px;
}

.lg-alt-link:hover { color: var(--lg-ink); border-bottom-color: var(--lg-ink); }

/* Mã vạch: bề rộng vạch không đều để đọc ra là mã vạch thật, không
   phải sọc trang trí. */
.lg-code {
    height: 34px;
    margin-top: 1.6rem;
    opacity: .78;
    background-image: repeating-linear-gradient( 90deg, var(--lg-ink) 0 2px, transparent 2px 5px, var(--lg-ink) 5px 6px, transparent 6px 8px, var(--lg-ink) 8px 11px, transparent 11px 13px, var(--lg-ink) 13px 14px, transparent 14px 18px );
}

/* ───────────────── Focus + tiếp cận ───────────────── */

.lg-page a:focus-visible {
    outline: 2px solid var(--lg-ink);
    outline-offset: 3px;
}

/* ───────────────── Vào trang ───────────────── */

@media (prefers-reduced-motion: no-preference) {
    .lg-say > *,
    .lg-slip-wrap {
        animation: lg-in .58s cubic-bezier(.16, 1, .3, 1) backwards;
    }

    .lg-headline { animation-delay: .05s; }
    .lg-sub      { animation-delay: .13s; }
    .lg-rule     { animation-delay: .19s; }
    .lg-slip-wrap { animation-delay: .1s; }

    @keyframes lg-in {
        from { opacity: 0; transform: translateY(14px); }
    }
    /* wrapper có transform tĩnh (xoay) nên cần keyframe riêng, kẻo
       animation ăn mất góc nghiêng ở frame cuối. */
    .lg-slip-wrap { animation-name: lg-in-slip; }

    @keyframes lg-in-slip {
        from { opacity: 0; transform: translateY(18px) rotate(-3.5deg); }
        to   { opacity: 1; transform: translateY(0) rotate(-1.15deg); }
    }
}

/* ───────────────── Mobile ───────────────── */

@media (max-width: 900px) {
    .lg-page {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 2.25rem;
        padding: 2.5rem 1.25rem 3rem;
        text-align: left;
    }

    .lg-say { max-width: none; }
    .lg-headline { font-size: clamp(1.85rem, 8vw, 2.5rem); }
    .lg-sub { max-width: 38ch; }
    .lg-rule { display: none; }

    .lg-slip-wrap {
        justify-self: center;
        max-width: 340px;
        transform: rotate(-.7deg);
    }
}

@media (max-width: 380px) {
    .lg-slip { padding-inline: 1.35rem; }
    .lg-mark { font-size: 1.4rem; }
}
