/*
 * Aitudo EDU — Đăng nhập / Đăng ký / Chọn vai trò (theo thiet-ke/*.png, khung 1672×941).
 * Máy tính: ".stage" đúng kích thước thiết kế, mọi chữ/form đặt theo toạ độ trên ảnh nền; CSS tự co khung vừa màn hình
 * (giữ tỉ lệ; tan(atan2()) = tỉ lệ, không cần JS) — phần dư tô màu mép ảnh (--edge-top / --edge-bot).
 * Điện thoại / màn dọc: bố cục dọc (ảnh nền thành dải banner, form full-width). Bản GPT cũ: v1-gpt/.
 */
.auth {
  --blue: #1268f4;
  --navy: #0d1146;
  --text: #2b3459;
  --muted: #6a7393;
  --line: #dfe6f0;
  --grad-text: linear-gradient(90deg, #0565fb 0%, #3d4cfc 55%, #7a30fe 100%);
  --grad-btn: linear-gradient(90deg, #1173fd 0%, #2b6efe 45%, #2c9bfd 100%);
}
.auth, .auth * { box-sizing: border-box; }
.auth { position: fixed; inset: 0; z-index: 0; font-family: var(--font-be-vietnam-pro), "Be Vietnam Pro", "Inter", Arial, sans-serif; color: var(--text); background: linear-gradient(var(--edge-top) 50%, var(--edge-bot) 50%); overflow: hidden; -webkit-font-smoothing: antialiased; }
.auth :where(a) { color: var(--blue); text-decoration: none; }
.auth :where(a):hover { text-decoration: underline; }
.auth :where(h1, h2, h3, p) { margin: 0; }
.auth :where(button, input) { font: inherit; color: inherit; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
/* --edge-*: màu mép trên / dưới của ảnh nền — tô phần dư khi màn khác tỉ lệ 1672×941 (không dùng ảnh mờ). */
.page-login { --bg: url("assets/bg-login.webp"); --edge-top: #c4dff3; --edge-bot: #257efd; }
.page-register { --bg: url("assets/bg-register.webp"); --edge-top: #c9e0f5; --edge-bot: #3187f9; }
.page-role { --bg: url("assets/bg-role.webp"); --edge-top: #cfe7f8; --edge-bot: #9dc8e1; }

/* ── Khung thiết kế ── */
.stage { position: absolute; left: 50%; top: 50%; width: 1672px; height: 941px; --fit: min(tan(atan2(100vw, 1672px)), tan(atan2(100vh, 941px))); transform: translate(-50%, -50%) scale(var(--s, var(--fit))); background: var(--bg) center / 100% 100% no-repeat; }
.stage > * { position: absolute; }
.m-logo { display: none; }

/* ── Chữ lớn bên trái ── */
.headline { font-weight: 800; letter-spacing: -1.5px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.headline span { display: block; }
.lead-left { color: #1b2a5a; font-weight: 500; }
.deco { color: #2c62e8; }
.deco svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Thẻ form ── */
.card { background: rgba(255, 255, 255, 0.94); border-radius: 32px; box-shadow: 0 30px 70px rgba(21, 60, 140, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); }
.card h1 { font-size: 42px; line-height: 1.15; font-weight: 800; color: var(--navy); letter-spacing: -0.6px; }
.card .lead { margin-top: 10px; font-size: 20px; color: #3b4566; }
.field { position: relative; display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; background: #fafbfd; transition: border-color 0.15s, box-shadow 0.15s; }
.field:focus-within { border-color: #7fb0fb; box-shadow: 0 0 0 4px rgba(18, 104, 244, 0.1); background: #fff; }
.field > .ic { color: var(--blue); font-size: 26px; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.field input::placeholder { color: #8a92ab; }
.eye { border: 0; background: none; padding: 6px; cursor: pointer; color: #5b6585; font-size: 24px; display: grid; place-items: center; }
.check { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.check input { appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 6px; border: 1.5px solid #b9c4d8; background: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.btn-primary { width: 100%; border: 0; border-radius: 14px; background: var(--grad-btn); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; box-shadow: 0 12px 26px rgba(17, 115, 253, 0.28); transition: filter 0.15s, transform 0.15s; }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary .end { position: absolute; right: 26px; display: grid; place-items: center; }
.divider { display: flex; align-items: center; gap: 16px; color: #6a7393; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #dde4ee; }
.socials { display: grid; grid-template-columns: 1fr 1fr; }
.social { display: flex; align-items: center; justify-content: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; color: #1b2350; font-weight: 500; transition: border-color 0.15s, box-shadow 0.15s; }
.social:hover { border-color: #a9c6f5; box-shadow: 0 6px 16px rgba(21, 60, 140, 0.08); }
.social svg { width: 26px; height: 26px; }
.switch { text-align: center; color: #3b4566; }
.switch a { font-weight: 700; }
.home-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.home-link .ic { font-size: 26px; }

/* ── Dải lợi ích trên sóng xanh ── */
.features { display: flex; align-items: center; color: #fff; }
.features .feat { display: flex; align-items: center; }
.features .ic { stroke-width: 1.6; }
.features .sep { width: 1.5px; background: rgba(255, 255, 255, 0.45); align-self: center; }

/* ════════ ĐĂNG NHẬP ════════ */
.page-login .headline { left: 468px; top: 158px; font-size: 61px; line-height: 69px; letter-spacing: -2px; }
.page-login .lead-left { left: 474px; top: 303px; font-size: 21.5px; line-height: 31px; }
.page-login .deco-hearts { left: 852px; top: 138px; width: 86px; height: 112px; }
.page-login .card { left: 1000px; top: 118px; width: 620px; height: 676px; padding: 44px 47px 0 47px; }
.page-login .field { height: 67px; margin-top: 20px; padding: 0 20px 0 22px; gap: 22px; }
.page-login form > .field:first-child { margin-top: 50px; }
.page-login .field input { font-size: 18.5px; }
.page-login .row { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; height: 28px; font-size: 17.5px; }
.page-login .row a { font-weight: 600; }
.page-login .btn-primary { margin-top: 31px; height: 67px; font-size: 23px; }
.page-login .btn-primary .ic { font-size: 26px; }
.page-login .divider { margin-top: 18px; font-size: 17.5px; }
.page-login .socials { margin-top: 15px; gap: 22px; }
.page-login .social { height: 60px; font-size: 16.5px; }
.page-login .switch { margin-top: 32px; font-size: 20px; }
.page-login .features { left: 236px; top: 832px; height: 74px; gap: 0; }
.page-login .feat { gap: 32px; font-size: 19px; line-height: 27px; }
.page-login .feat .ic { font-size: 56px; }
.page-login .feat:nth-of-type(1) { width: 290px; }
.page-login .feat:nth-of-type(2) { width: 300px; margin-left: 72px; }
.page-login .feat:nth-of-type(3) { margin-left: 64px; }
.page-login .sep { height: 44px; }
.page-login .deco-plane { left: 1452px; top: 818px; width: 120px; height: 100px; color: rgba(255, 255, 255, 0.9); }

/* ════════ ĐĂNG KÝ ════════ */
.brand { display: flex; align-items: center; gap: 8px; color: var(--navy); }
.brand img { width: 70px; height: 70px; object-fit: contain; }
.brand b { display: block; font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -0.6px; }
.brand b em { font-style: normal; background: linear-gradient(90deg, #1268f4, #5a22fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { display: block; margin-top: 5px; font-size: 15.5px; font-weight: 500; }
.page-register .brand { left: 208px; top: 20px; }
.page-register .home-link { left: 1456px; top: 24px; font-size: 15.5px; }
.page-register .headline { left: 214px; top: 118px; font-size: 68px; line-height: 77px; letter-spacing: -2.2px; }
.page-register .deco-plane { left: 604px; top: 118px; width: 196px; height: 140px; }
.page-register .lead-left { left: 220px; top: 285px; font-size: 21.5px; line-height: 29px; }
.chips { left: 48px; top: 362px; display: grid; grid-template-columns: 226px 208px; gap: 17px 16px; }
.chip { height: 68px; border-radius: 34px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 10px 26px rgba(21, 60, 140, 0.1); display: flex; align-items: center; gap: 14px; padding: 0 12px 0 14px; font-size: 15.5px; letter-spacing: -0.2px; line-height: 21px; font-weight: 500; color: #1b2350; }
.chip i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 24px; flex-shrink: 0; }
.chip .c-blue { background: linear-gradient(140deg, #3b8bff, #1268f4); }
.chip .c-green { background: linear-gradient(140deg, #2fd08f, #11a86f); }
.chip .c-purple { background: linear-gradient(140deg, #9c6cff, #7a3ff2); }
.chip .c-orange { background: linear-gradient(140deg, #ffb340, #ff8a00); }
.page-register .card { left: 957px; top: 66px; width: 573px; height: 827px; padding: 30px 32px 0; }
.page-register .card h1 { padding-left: 13px; font-size: 40px; }
.page-register .card .lead { padding-left: 13px; margin-top: 6px; font-size: 19.5px; }
.steps { display: flex; justify-content: space-between; margin: 30px 30px 0 28px; }
.steps span { display: flex; align-items: center; gap: 14px; font-size: 16.5px; color: #4a5478; }
.steps b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #eef1f6; color: #6a7393; font-size: 17px; font-weight: 600; }
.steps .on { color: var(--navy); font-weight: 600; }
.steps .on b { background: #006cfd; color: #fff; box-shadow: 0 0 0 4px rgba(0, 108, 253, 0.14); }
.steps .done b { background: #dbeafe; color: var(--blue); }
.reg-step { display: none; }
.reg-step.on { display: block; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
.grid2 > .field { min-width: 0; }
.page-register .fields { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.box { height: 66px; padding: 0 18px 0 20px; gap: 18px; border-radius: 12px; background: #fff; }
.box > .ic { font-size: 26px; }
.box .lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.box .lbl > span { font-size: 15.5px; font-weight: 500; color: var(--navy); }
.box .lbl > span em { font-style: normal; color: #e5222e; }
.box input { font-size: 15.5px; padding: 0; }
.page-register .agree { margin-top: 20px; padding-left: 19px; align-items: flex-start; font-size: 15px; line-height: 22px; color: #3b4566; }
.page-register .agree input { width: 22px; height: 22px; margin-top: 1px; }
.page-register .btn-primary { margin-top: 16px; height: 59px; border-radius: 12px; font-size: 21px; }
.page-register .btn-primary .end { right: 14px; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #1d7cfd; font-size: 20px; }
.page-register .btn-row { margin-top: 26px; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 14px; }
.page-register .btn-row .btn-primary { margin-top: 0; }
.btn-ghost { height: 59px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: #1b2350; font-size: 18px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; }
.page-register .divider { margin-top: 18px; font-size: 15.5px; }
.page-register .socials { margin-top: 12px; gap: 15px; }
.page-register .social { height: 53px; font-size: 17.5px; }
.page-register .switch { margin-top: 24px; font-size: 16.5px; }
.done-box { text-align: center; padding: 26px 10px 0; }
.done-box .ok { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, #2fd08f, #11a86f); color: #fff; font-size: 44px; box-shadow: 0 14px 30px rgba(17, 168, 111, 0.3); }
.done-box h2 { margin-top: 20px; font-size: 26px; color: var(--navy); }
.done-box p { margin: 10px auto 0; max-width: 380px; font-size: 16.5px; line-height: 1.6; color: #4a5478; }
.page-register .features { left: 66px; top: 862px; height: 52px; }
.page-register .feat { gap: 24px; font-size: 15.5px; line-height: 21px; }
.page-register .feat .ic { font-size: 46px; }
.page-register .feat:nth-of-type(1) { width: 200px; }
.page-register .feat:nth-of-type(2) { width: 220px; margin-left: 34px; }
.page-register .feat:nth-of-type(3) { margin-left: 38px; }
.page-register .sep { height: 40px; }

/* ════════ CHỌN VAI TRÒ ════════ */
.page-role .home-link { left: 1514px; top: 22px; font-size: 16.5px; }
.page-role .headline { left: 430px; top: 128px; font-size: 47px; line-height: 56px; letter-spacing: -1.6px; white-space: nowrap; }
.page-role .deco-heart { left: 778px; top: 202px; width: 28px; height: 26px; }
.page-role .lead-left { left: 434px; top: 307px; font-size: 20px; line-height: 28px; }
.page-role .card { left: 835px; top: 70px; width: 787px; height: 833px; padding-top: 40px; text-align: center; }
.page-role .card h1 { font-size: 40px; }
.page-role .card h1 em { font-style: normal; background: linear-gradient(90deg, #1268f4, #3a2cfd 60%, #6a2df0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-role .card .lead { margin-top: 12px; font-size: 20.5px; }
.roles { position: absolute; left: 35px; right: 36px; top: 158px; display: flex; flex-direction: column; gap: 15px; text-align: left; }
.role { position: relative; display: flex; align-items: center; height: 147px; border-radius: 20px; border: 1.5px solid; overflow: hidden; cursor: pointer; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.role:hover, .role:focus-visible { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(21, 60, 140, 0.12); outline: none; }
.role.first { height: 155px; }
.role img { width: 234px; height: 100%; object-fit: cover; object-position: left bottom; flex-shrink: 0; }
.role .txt { padding-left: 15px; flex: 1; }
.role b { display: block; font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.3px; }
.role small { display: block; margin-top: 12px; font-size: 18px; line-height: 27px; color: #4a5478; }
.role .go { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin-right: 28px; color: var(--navy); font-size: 24px; box-shadow: 0 6px 16px rgba(21, 60, 140, 0.1); }
.role .go .ic { stroke-width: 2.4; }
.r-admin { background: linear-gradient(90deg, #dfeefe, #e7f3fd); border-color: #79affe; box-shadow: 0 12px 30px rgba(18, 104, 244, 0.14); }
.r-teacher { background: linear-gradient(90deg, #f7e9fe, #f7effc); border-color: #efc1fe; }
.r-parent { background: linear-gradient(90deg, #fef5e3, #fdf7eb); border-color: #fee1aa; }
.r-student { background: linear-gradient(90deg, #e2f9f5, #e6f9f5); border-color: #c9f2eb; }
.role.picked { box-shadow: 0 0 0 4px rgba(18, 104, 244, 0.22), 0 14px 30px rgba(21, 60, 140, 0.12); }

/* ════════ Điện thoại / màn dọc: bố cục dọc ════════ */
@media (max-width: 900px), (max-aspect-ratio: 23/20) {
  .auth { overflow: auto; background: #f3f7fd; }
  .stage { position: relative; left: auto; top: auto; width: auto; height: auto; min-height: 100vh; transform: none; box-shadow: none; padding: 0 16px 28px; background: linear-gradient(#0000 0, #0000 200px, #f3f7fd 290px), var(--bg) 14% -112px / auto 410px no-repeat, #f3f7fd; }
  /* Ảnh nền đẩy lên 112px để logo in sẵn trong ảnh (login/role) không lộ — logo dùng .m-logo. */
  .stage > * { position: static; left: auto !important; top: auto !important; }
  .headline, .lead-left, .deco, .deco-hearts, .deco-plane, .deco-heart, .chips, .features { display: none !important; }
  .m-logo { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 4px 14px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.88); text-decoration: none !important; }
  .m-logo img { width: 40px; height: 40px; }
  .m-logo b { font-size: 21px; color: var(--navy); font-weight: 800; }
  .m-logo b em { font-style: normal; color: var(--blue); }
  .page-register .brand { display: none; }
  .home-link { position: absolute !important; right: 16px; top: 22px; font-size: 14px !important; background: rgba(255, 255, 255, 0.85); padding: 6px 12px; border-radius: 999px; }
  .card { position: relative !important; width: auto !important; height: auto !important; margin-top: 150px; padding: 26px 20px 26px !important; border-radius: 24px; }
  .card h1 { font-size: 30px !important; padding-left: 0 !important; }
  .card .lead { font-size: 16px !important; padding-left: 0 !important; }
  .page-login .field, .box { height: 58px; }
  .page-login .row { font-size: 15px; }
  .page-login .btn-primary { height: 58px; font-size: 19px; }
  .page-login .social, .page-register .social { height: 52px; font-size: 14px; }
  .page-login .switch, .page-register .switch { font-size: 15px; }
  .steps { margin: 22px 0 0; }
  .steps span { font-size: 13.5px; gap: 7px; white-space: nowrap; }
  .steps b { width: 30px; height: 30px; font-size: 15px; }
  .grid2 { grid-template-columns: 1fr; gap: 16px; }
  .page-register .agree { padding-left: 0; }
  .roles { position: static; margin-top: 22px; }
  .role, .role.first { height: auto; min-height: 104px; align-items: stretch; }
  .role img { width: 92px; height: auto; align-self: stretch; object-position: 64% bottom; }
  .role .txt { padding: 12px 6px 12px 10px; align-self: center; }
  .role b { font-size: 17px; }
  .role small { font-size: 13.5px; line-height: 19px; margin-top: 4px; }
  .role small br { display: none; }
  .role .go { align-self: center; }
  .role .go { width: 40px; height: 40px; margin-right: 14px; font-size: 20px; }
}

/* ── Trạng thái dùng trong app (edu.aitudo.vn) ── */
.err { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #fdecee; color: #c5162a; font-size: 15px; line-height: 1.5; }
.field.bad { border-color: #f08b97; background: #fff8f9; }
.field-err { display: block; margin: 6px 0 0 4px; color: #c5162a; font-size: 13.5px; }
.note { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #eaf3ff; color: #1f4e9c; font-size: 15px; line-height: 1.5; }
.auth a.social:hover, .auth a.btn-primary:hover { text-decoration: none; }
.auth a.btn-primary { color: #fff; }
.auth a.social { color: #1b2350; }
.btn-primary:disabled { opacity: 0.65; cursor: wait; transform: none; }
.role.off { cursor: default; opacity: 0.55; filter: saturate(0.6); }
.role.off:hover { transform: none; box-shadow: none; }
.role .soon { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: rgba(13, 17, 70, 0.08); color: #4a5478; font-size: 13px; font-weight: 600; vertical-align: middle; }
button.role { width: 100%; font: inherit; text-align: left; background-clip: padding-box; }
.page-login .card, .page-register .card { height: auto; padding-bottom: 34px; }
