/* ATS-Hotel — Trang đăng nhập (tách từ templates/login.html — sửa CSS tại đây) */
    :root {
      --bg: #070b17;
      --panel: rgba(255, 255, 255, .06);
      --line: rgba(255, 255, 255, .12);
      --fg: #f2f5ff;
      --muted: #8d97b8;
      --a: #6366f1;
      --b: #22d3ee;
      --c: #a78bfa;
      --ok: #34d399
    }

    * {
      box-sizing: border-box
    }

    html,
    body {
      height: 100%
    }

    body {
      margin: 0;
      min-height: 100vh;
      min-height: 100dvh;
      background: var(--bg);
      color: var(--fg);
      font: 16px/1.55 Inter, "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
      overflow: hidden
    }

    .aurora {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      overflow: hidden
    }

    .aurora i {
      position: absolute;
      border-radius: 50%;
      filter: blur(90px);
      opacity: .55
    }

    .aurora i:nth-child(1) {
      width: 520px;
      height: 520px;
      background: #4f46e5;
      top: -160px;
      left: -120px
    }

    .aurora i:nth-child(2) {
      width: 460px;
      height: 460px;
      background: #0891b2;
      bottom: -160px;
      left: 30%;
      opacity: .35
    }

    .aurora i:nth-child(3) {
      width: 420px;
      height: 420px;
      background: #7c3aed;
      top: 10%;
      right: -140px;
      opacity: .45
    }

    .grid {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      opacity: .5;
      background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
      background-size: 56px 56px;
      -webkit-mask-image: radial-gradient(circle at 40% 40%, #000, transparent 70%);
      mask-image: radial-gradient(circle at 40% 40%, #000, transparent 70%)
    }

    /* Trang tự co giãn vừa khung hình: 100dvh (truý URL bar trên mobile),
   padding/gap theo clamp(), KHÔNG cuộn trang — nội dung thừa được
   cắt theo từng tầng chiều cao (xem media query phía dưới). */
    .page {
      position: relative;
      z-index: 1;
      height: 100dvh;
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      align-items: center;
      gap: clamp(24px, 4vw, 56px);
      padding: clamp(16px, 3.5vh, 40px) clamp(16px, 5vw, 6vw);
      max-width: 1380px;
      margin: 0 auto;
      overflow: hidden
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 700;
      font-size: 18px
    }

    .brand i {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--a), var(--b));
      display: grid;
      place-items: center;
      font-style: normal;
      font-weight: 800
    }

    .tag {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin: clamp(14px, 3.5vh, 44px) 0 18px;
      padding: 6px 14px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--panel);
      font-size: 13px;
      color: var(--muted)
    }

    .tag b {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--ok);
      box-shadow: 0 0 10px var(--ok)
    }

    /* Brand chỉ hiện trên mobile (≤900px) — desktop đã có cột trái riêng */
    .brand-mobile {
      display: none
    }

    /* Tiêu đề co theo CẢ chiều rộng lẫn chiều cao (min của 2) -> không tràn/đè */
    h1 {
      margin: 0;
      font-size: clamp(26px, min(4.4vw, 6vh), 58px);
      line-height: 1.08;
      letter-spacing: -.03em;
      font-weight: 800
    }

    h1 span {
      background: linear-gradient(90deg, #a5b4fc, #67e8f9);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent
    }

    .lead {
      color: var(--muted);
      max-width: 480px;
      margin: clamp(10px, 2vh, 18px) 0 0;
      font-size: clamp(14px, 1.2vw+8px, 17px)
    }

    /* Bảng điều khiển mô phỏng */
    .dash {
      margin-top: clamp(14px, 3vh, 38px);
      max-width: 520px;
      padding: 18px;
      border-radius: 20px;
      border: 1px solid var(--line);
      background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      box-shadow: 0 30px 60px rgba(0, 0, 0, .4);
      animation: fl 7s ease-in-out infinite
    }

    @keyframes fl {
      50% {
        transform: translateY(-8px)
      }
    }

    .kpis {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px
    }

    .kpi {
      padding: 12px;
      border-radius: 14px;
      background: rgba(255, 255, 255, .05);
      border: 1px solid var(--line)
    }

    .kpi small {
      color: var(--muted);
      font-size: 12px
    }

    .kpi b {
      display: block;
      font-size: 22px;
      letter-spacing: -.02em
    }

    .kpi em {
      font-style: normal;
      font-size: 12px;
      color: var(--ok)
    }

    .chart {
      display: flex;
      align-items: flex-end;
      gap: 7px;
      height: 76px;
      margin: 16px 4px 6px
    }

    .chart span {
      flex: 1;
      border-radius: 6px 6px 2px 2px;
      background: linear-gradient(180deg, var(--b), var(--a));
      opacity: .85
    }

    .rooms {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 12px
    }

    .rooms u {
      text-decoration: none;
      font-size: 11px;
      padding: 4px 9px;
      border-radius: 8px;
      border: 1px solid var(--line);
      color: var(--muted)
    }

    .rooms u.on {
      color: #a7f3d0;
      border-color: rgba(52, 211, 153, .4);
      background: rgba(52, 211, 153, .1)
    }

    .rooms u.bk {
      color: #c7d2fe;
      border-color: rgba(129, 140, 248, .4);
      background: rgba(99, 102, 241, .14)
    }

    .rooms u.cl {
      color: #fde68a;
      border-color: rgba(251, 191, 36, .35);
      background: rgba(251, 191, 36, .08)
    }

    /* Form — card tự chứa trong khung hình; overflow:auto chỉ là van an toàn
   khi zoom 200% hoặc màn hình hiếm thấy, bình thường KHÔNG hiện thanh cuộn */
    .card {
      width: 100%;
      max-width: 420px;
      max-height: 100%;
      justify-self: center;
      padding: clamp(20px, 3.2vh, 34px) clamp(18px, 2.5vw, 34px);
      border-radius: 24px;
      border: 1px solid var(--line);
      background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
      backdrop-filter: blur(22px);
      -webkit-backdrop-filter: blur(22px);
      box-shadow: 0 40px 80px rgba(0, 0, 0, .45);
      overflow: auto;
      scrollbar-width: none
    }

    .card::-webkit-scrollbar {
      display: none
    }

    .card h2 {
      margin: 0;
      font-size: clamp(22px, 3vh, 28px);
      letter-spacing: -.02em
    }

    .sub {
      color: var(--muted);
      margin: 6px 0 clamp(14px, 2.5vh, 24px);
      font-size: 15px
    }

    .f {
      position: relative;
      margin-bottom: 14px
    }

    .f svg {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      width: 18px;
      height: 18px;
      stroke: var(--muted);
      fill: none;
      stroke-width: 1.8
    }

    .f input {
      width: 100%;
      padding: 14px 14px 14px 44px;
      border-radius: 14px;
      border: 1px solid var(--line);
      background: rgba(7, 11, 23, .55);
      color: var(--fg);
      font: inherit;
      transition: border-color .2s, box-shadow .2s
    }

    .f input::placeholder {
      color: #5f6a8d
    }

    .f input:focus {
      outline: 0;
      border-color: var(--a);
      box-shadow: 0 0 0 4px rgba(99, 102, 241, .22)
    }

    .f.has-toggle input {
      padding-right: 64px
    }

    .f button {
      position: absolute;
      right: 6px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: 0;
      color: var(--muted);
      font-size: 13px;
      cursor: pointer;
      padding: 10px;
      min-width: 40px;
      min-height: 40px
    }

    .f button:hover {
      color: var(--fg)
    }

    .row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 4px 0 clamp(14px, 2.5vh, 22px);
      font-size: 14px;
      color: var(--muted);
      gap: 8px;
      flex-wrap: wrap
    }

    .row label {
      display: flex;
      gap: 8px;
      align-items: center;
      cursor: pointer
    }

    .row input {
      accent-color: var(--a)
    }

    .hint {
      font-size: 12px;
      color: var(--muted);
      opacity: .85;
      text-align: right
    }

    .btn {
      width: 100%;
      padding: 15px;
      border: 0;
      border-radius: 14px;
      font: inherit;
      font-weight: 700;
      color: #fff;
      cursor: pointer;
      background: linear-gradient(135deg, var(--a), var(--c) 55%, var(--b));
      background-size: 160% 100%;
      box-shadow: 0 12px 30px rgba(99, 102, 241, .45);
      transition: background-position .4s, transform .15s
    }

    .btn:hover {
      background-position: 100% 0;
      transform: translateY(-1px)
    }

    .btn:disabled {
      opacity: .75;
      cursor: wait;
      transform: none
    }

    .msg {
      min-height: 20px;
      margin: 12px 0 0;
      font-size: 13px;
      color: #fbbf24;
      text-align: center
    }

    .msg.err {
      color: #fca5a5
    }

    @keyframes shake {

      0%,
      100% {
        transform: translateX(0)
      }

      20%,
      60% {
        transform: translateX(-6px)
      }

      40%,
      80% {
        transform: translateX(6px)
      }
    }

    .msg.shake {
      animation: shake .4s ease
    }

    .help {
      margin-top: clamp(10px, 2vh, 18px);
      text-align: center;
      font-size: 13px;
      color: var(--muted)
    }

    .help a {
      color: #a5b4fc;
      text-decoration: none;
      font-weight: 600
    }

    .footer-text {
      text-align: center;
      font-size: 11.5px;
      color: var(--muted);
      margin-top: 10px;
      line-height: 1.6
    }

    .footer-text .sep {
      opacity: .4;
      margin: 0 4px
    }

    @keyframes spin {
      from {
        transform: rotate(0)
      }

      to {
        transform: rotate(360deg)
      }
    }

    .fa-spin-custom {
      animation: spin .8s linear infinite;
      display: inline-block;
      vertical-align: -2px;
      margin-right: 6px
    }

    /* ── THUẬT TOÁN AUTO-FIT theo chiều cao: màn hình càng thấp càng cắt bớt
      lớp trang trí từ ngoài vào trong (dash -> lead -> footer/help -> sub)
      để khối form luôn vừa vặn, không cần cuộn ── */
    @media (max-height:900px) {
      .dash {
        padding: 14px
      }

      .chart {
        height: 60px
      }
    }

    @media (max-height:780px) {
      .dash {
        display: none
      }
    }

    @media (max-height:600px) {
      .lead {
        display: none
      }

      .tag {
        margin: 10px 0 12px
      }
    }

    @media (max-height:520px) {

      .help,
      .footer-text {
        display: none
      }

      .sub {
        display: none
      }

      .card h2 {
        margin-bottom: 14px
      }

      .f {
        margin-bottom: 10px
      }

      .f input {
        padding-top: 12px;
        padding-bottom: 12px
      }

      .f button {
        top: calc(50% - 1px)
      }
    }

    /* ── Auto-fit theo chiều rộng ── */
    @media (max-width:1100px) {
      .dash {
        max-width: 100%
      }
    }

    @media (max-width:900px) {
      /* Cho phép cuộn: khi bàn phím ảo mở, chiều cao khả dụng giảm mạnh,
         không khoá overflow nữa để form luôn với tới được */
      body {
        overflow: auto
      }

      .page {
        grid-template-columns: 1fr;
        gap: 0;
        align-items: center;
        height: auto;
        min-height: 100dvh;
        padding: max(16px, var(--sat)) 20px calc(20px + var(--sab));
        overflow: visible
      }

      .page>section:first-child {
        display: none
      }

      .brand-mobile {
        display: flex;
        margin-bottom: 4px;
        font-size: 16px
      }

      .brand-mobile i {
        width: 32px;
        height: 32px;
        border-radius: 10px
      }

      .card {
        max-width: 440px;
        max-height: none
      }
    }

    @media (max-width:480px) {
      .page {
        padding-left: 14px;
        padding-right: 14px
      }

      .card {
        border-radius: 20px;
        padding-top: 22px;
        padding-bottom: 26px
      }

      .card h2 {
        font-size: 24px
      }

      .sub {
        font-size: 14px
      }

      .f input {
        padding-top: 13px;
        padding-bottom: 13px
      }

      .btn {
        padding: 14px
      }

      .help {
        font-size: 12.5px;
        line-height: 1.6
      }

      .footer-text {
        font-size: 11px
      }
    }

    @media (prefers-reduced-motion:reduce) {
      .dash {
        animation: none
      }

      .msg.shake {
        animation: none
      }
    }
