/* UNext account page (/account) and the legal pages (/terms, /privacy). Uses the tokens in site.css. */

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; text-decoration: none; }

/* Nav user chip */
.user-chip { display: inline-flex; align-items: center; gap: 10px; margin-left: 10px; min-width: 0; }
.user-chip[hidden] { display: none; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); flex: none; }
.user-chip img[hidden] { display: none; }
.user-email { color: var(--text-dim); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons used here */
.btn-xs { padding: 7px 12px; font-size: 13px; border-radius: 7px; gap: 6px; }
.btn-danger { background: linear-gradient(180deg, #ea5a4e, #c93a2f); color: #fff; box-shadow: 0 6px 20px rgba(224, 72, 60, .3); }
.btn-danger-ghost { background: transparent; color: #ff8a80; border-color: rgba(224, 72, 60, .45); }
.btn-danger-ghost:hover { background: rgba(224, 72, 60, .12); border-color: var(--bad); }
.btn-google { background: #fff; color: #1f2328; border-color: #dadce0; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); padding: 15px 28px; }
.btn-google:hover { box-shadow: 0 10px 32px rgba(0, 0, 0, .45); }
.btn-google svg { width: 22px; height: 22px; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

/* Layout */
.acc { padding: 48px 0 0; min-height: calc(100vh - var(--nav-h) - 200px); }
.acc .container { max-width: 900px; }
.acc-view[hidden] { display: none; }
.acc-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 120px 0; color: var(--text-dim); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.acc-alert { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; padding: 14px 18px; border-radius: 12px; background: rgba(224, 72, 60, .1); border: 1px solid rgba(224, 72, 60, .45); color: #ffc9c4; }
.acc-alert[hidden] { display: none; }
.acc-alert span { flex: 1 1 240px; }

/* Signed-out hero */
.acc-hero { text-align: center; padding: 40px 0 20px; }
.acc-hero h1 { font-size: clamp(32px, 5.5vw, 52px); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.acc-hero .accent { color: var(--accent); white-space: nowrap; }
.acc-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 56px auto 0; max-width: 760px; }
.perk { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: grid; gap: 2px; }
.perk b { font-size: 20px; color: var(--text); }
.perk span { font-size: 14px; color: var(--text-dim); }

/* Signed-in head */
.acc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.acc-head h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; overflow-wrap: anywhere; }
.acc-sub { margin: 4px 0 0; color: var(--text-dim); overflow-wrap: anywhere; }
.acc-notice { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; border: 1px solid var(--border); background: var(--surface); }
.acc-notice[hidden] { display: none; }
.acc-notice.warn { border-color: rgba(224, 166, 60, .5); background: rgba(224, 166, 60, .1); color: #ffe0a6; }
.acc-notice.bad { border-color: rgba(224, 72, 60, .5); background: rgba(224, 72, 60, .1); color: #ffc9c4; }

.panel { background: linear-gradient(180deg, var(--surface), #171c22); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 28px; }
.panel[hidden] { display: none; }
.panel-head h2 { font-size: 22px; font-weight: 700; }
.panel-head p { margin: 6px 0 22px; color: var(--text-dim); }

/* Form */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 500; }
.req-mark { color: var(--bad); }
.opt { color: var(--text-dim); font-weight: 400; }
.field input, .field select {
  width: 100%; font: 400 16px/1.4 var(--font); color: var(--text); background: var(--field-bg);
  border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a1ad' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }
.field input:hover, .field select:hover { border-color: #46566a; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 166, 255, .25); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field-err { min-height: 0; font-size: 13px; color: #ff8a80; }
.field-err:empty { display: none; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; cursor: pointer; color: var(--text-dim); }
.check input { width: 19px; height: 19px; margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.check input[aria-invalid="true"] { outline: 2px solid var(--bad); outline-offset: 2px; }
.reg-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.reg-email { color: var(--text-dim); font-size: 14px; overflow-wrap: anywhere; }
.reg-email b { color: var(--text); font-weight: 500; }

/* Key card */
.keycard { border-color: rgba(47, 166, 255, .5); background: radial-gradient(600px 220px at 20% 0, rgba(47, 166, 255, .14), transparent 70%), linear-gradient(180deg, var(--surface), #161b20); box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.keycard-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.keycard-exp { font-size: 14px; color: var(--text-dim); }
.keycard-exp.expired, .keycard-exp.revoked { color: #ff8a80; }
.keycard h2 { font-size: 22px; margin: 12px 0 12px; }
.keyrow { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.keycard-sub { font-size: 15px; font-weight: 500; color: var(--text-dim); }
.bigkey { flex: 1 1 320px; min-width: 0; display: block; font-family: var(--font-mono); font-size: clamp(26px, 6vw, 40px); font-weight: 700; letter-spacing: .16em; line-height: 1.3; text-align: center; padding: 18px 18px; border-radius: 12px; color: #e3f3ff; white-space: nowrap; user-select: all; }
.bigkey-none { font-size: 15px; font-weight: 500; letter-spacing: 0; text-align: center; color: var(--text-dim); user-select: none; }
.lic-key code.none { color: var(--text-dim); font-family: inherit; }
.steps3 { list-style: none; counter-reset: s; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps3 li { counter-increment: s; position: relative; background: rgba(13, 17, 20, .6); border: 1px solid var(--border); border-radius: 12px; padding: 16px 16px 16px 56px; display: grid; gap: 2px; font-size: 14px; }
.steps3 li::before { content: counter(s); position: absolute; left: 14px; top: 15px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(180deg, #3cb0ff, #1f8fe6); }
.steps3 li b { font-size: 15px; }
.steps3 li span { color: var(--text-dim); }

/* Badges and pills */
.badge { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 12px; border: 1px solid; }
.badge-trial { color: #9fd4ff; background: var(--accent-soft); border-color: rgba(47, 166, 255, .45); }
.badge-paid { color: #9ff0bb; background: rgba(55, 173, 95, .14); border-color: rgba(55, 173, 95, .5); }
.badge-free { color: #e6d2ff; background: rgba(160, 110, 255, .14); border-color: rgba(160, 110, 255, .45); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; border-radius: 6px; padding: 2px 9px; background: var(--surface2); color: var(--text-dim); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-active { color: #7fe0a0; }
.pill-expired { color: #f0c070; }
.pill-revoked { color: #ff8a80; }
.pill-off { color: #7d8b97; }

/* Licences */
.acc-sec { margin-bottom: 28px; }
.acc-h2 { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.lic-list { display: grid; gap: 16px; }
/* Expired and withdrawn keys, folded under "คีย์เก่า" */
.lic-old { border: 1px dashed var(--border); border-radius: 14px; padding: 4px 18px; }
.lic-old[open] { padding-bottom: 18px; }
.lic-old > summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--text-dim); list-style-position: inside; }
.lic-old > summary:hover, .lic-old > summary:focus-visible { color: var(--text); }
.lic-old-sub { margin-left: 10px; font-weight: 400; font-size: .9em; opacity: .8; }
.lic-old .lic { opacity: .85; }
.lic-empty { padding: 26px; text-align: center; color: var(--text-dim); border: 1px dashed var(--border); border-radius: 14px; }
.lic { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; min-width: 0; }
.lic-expired, .lic-revoked { opacity: .82; }
.lic-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lic-edition { font-weight: 600; }
.lic-serial { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }
.lic-key { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.lic-key code { flex: 1; min-width: 0; padding: 8px 12px; font-size: 13.5px; word-break: break-all; }
.lic-key code.short { font-family: var(--font-mono); font-size: 18px; font-weight: 700; letter-spacing: .14em; color: #e3f3ff; word-break: normal; white-space: nowrap; }
.lic-meta { display: grid; grid-template-columns: repeat(5, auto); gap: 4px 22px; margin: 16px 0 0; font-size: 14px; }
.lic-meta dt { color: var(--text-dim); font-size: 12.5px; grid-row: 1; }
.lic-meta dd { margin: 0; grid-row: 2; overflow-wrap: anywhere; }
.daysbar { margin-top: 16px; }
.daysbar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 6px; color: var(--text-dim); }
.daysbar-label span:first-child { color: var(--text); font-weight: 500; }
.daysbar-track { height: 8px; border-radius: 999px; background: var(--field-bg); border: 1px solid var(--border); overflow: hidden; }
.daysbar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1f8fe6, #3cb0ff); }
.daysbar.warn .daysbar-track i { background: linear-gradient(90deg, #c98a1e, var(--warn)); }
.daysbar.bad .daysbar-track i { background: var(--bad); }

.machines { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.machines h3 { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.machines ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.machines li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--field-bg); border: 1px solid var(--border); }
.machines li.off { opacity: .7; }
.m-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fa6ff' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E") center/17px no-repeat; }
.m-text { flex: 1 1 170px; min-width: 0; display: grid; }
.m-text b { font-weight: 600; overflow-wrap: anywhere; }
.m-text small { color: var(--text-dim); font-size: 12.5px; }
.machines-empty { margin: 0; color: var(--text-dim); font-size: 14px; }

/* Buy box */
.buy { display: flex; gap: 18px; align-items: flex-start; }
.buy .icon { margin: 0; flex: none; }
.buy h2 { font-size: 18px; }
.buy .buy-line { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; white-space: normal; }
.buy .buy-line b { color: var(--text); }
.buy p { margin: 4px 0 0; color: var(--text-dim); white-space: pre-line; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 8, 10, .7); backdrop-filter: blur(3px); }
.modal-box { position: relative; width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.modal-box h2 { font-size: 19px; }
.modal-box p { margin: 10px 0 0; color: var(--text-dim); font-size: 15px; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
body.modal-open { overflow: hidden; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 300; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 10px; background: #26303a; border: 1px solid var(--border); color: var(--text); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: 15px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: rgba(55, 173, 95, .6); }
.toast.bad { border-color: rgba(224, 72, 60, .6); }

/* Legal pages */
.legal { padding: 48px 0 0; }
.legal .container { max-width: 780px; }
.legal h1 { font-size: clamp(28px, 4.5vw, 40px); font-weight: 700; }
.legal .updated { color: var(--text-dim); margin: 6px 0 32px; font-size: 14px; }
.legal h2 { font-size: 20px; margin: 32px 0 8px; }
.legal p, .legal li { color: #c7d0d8; }
.legal ul, .legal ol { padding-left: 22px; }
.legal li + li { margin-top: 4px; }

/* Responsive */
@media (max-width: 760px) {
  .steps3 { grid-template-columns: 1fr; }
  .lic-meta { grid-template-columns: auto 1fr; gap: 6px 16px; }
  .lic-meta dt, .lic-meta dd { grid-row: auto; }
  .acc-perks { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
  .lic { padding: 16px; }
  .acc { padding-top: 28px; }
  .acc-hero { padding-top: 20px; }
  .user-email { display: none; }
  .user-chip { margin-left: 4px; gap: 8px; }
  .machines li { flex-wrap: wrap; }
  .machines li .btn, .machines li .pill { margin-left: 42px; }
  .keyrow .btn { flex: 1 1 100%; }
  .buy { flex-direction: column; gap: 12px; }
}
