/*
 * V-Tuning panel – ekrany logowania, rejestracji, aktywacji i resetu hasła.
 * Widoki: admin/auth/*.php (na razie tylko dla $allowedIp).
 * Motyw: html[data-ui-theme="dark"] – ten sam cookie vt_ui_theme_mode co w panelu.
 */

:root {
    color-scheme: light;
    --bg: #F2F4F7;
    --card: #FFFFFF;
    --card-bd: #E3E7EB;
    --shadow: 0 24px 60px rgba(16, 24, 40, .10);
    --input: #FFFFFF;
    --bd: #D5DBE1;
    --bd2: #C3CBD3;
    --t1: #1E2328;
    --t2: #59616B;
    --t3: #6C757D;
    --link: #2F64B5;
    --link-hover: #1F4E94;
    --ring: rgba(47, 100, 181, .25);
    --menu: #FFFFFF;
    --hover: #F1F4F7;
    --on: #1E2328;
    --on-t: #FFFFFF;
    --chk: #2F64B5;
    --ok: #287A42;
    --ok-bg: #EDF6EF;
    --warn: #8A6500;
    --warn-bg: #FFF4D1;
    --warn-bd: #E6B935;
    --warn-t: #6B4F00;
    --err: #B4382D;
    --err-bg: #FBEAE8;
    --err-bd: #EDB8B2;
    --err-t: #8E2A21;
    --info: #2F64B5;
    --info-bg: #EAF1FC;
    --meter: #E3E7EB;
    --cta: #D71F26;
    --cta-hover: #B9171D;
}
html[data-ui-theme="dark"] {
    color-scheme: dark;
    --bg: #0B0F16;
    --card: #121822;
    --card-bd: #263142;
    --shadow: 0 30px 80px rgba(0, 0, 0, .45);
    --input: #0F141C;
    --bd: #263142;
    --bd2: #34425A;
    --t1: #E6EDF5;
    --t2: #A7B4C6;
    --t3: #7A879A;
    --link: #5B9BF0;
    --link-hover: #8BB8F5;
    --ring: rgba(91, 155, 240, .35);
    --menu: #18202C;
    --hover: #1F2937;
    --on: #E6EDF5;
    --on-t: #0B0F16;
    --chk: #5B9BF0;
    --ok: #3DCB72;
    --ok-bg: rgba(61, 203, 114, .12);
    --warn: #F2B630;
    --warn-bg: rgba(242, 182, 48, .10);
    --warn-bd: rgba(242, 182, 48, .55);
    --warn-t: #F7D88C;
    --err: #FF6B61;
    --err-bg: rgba(255, 107, 97, .12);
    --err-bd: rgba(255, 107, 97, .5);
    --err-t: #FFC2BC;
    --info: #5B9BF0;
    --info-bg: rgba(91, 155, 240, .14);
    --meter: #263142;
}

/* ---------- baza ---------- */
.vt-auth, .vt-auth * { box-sizing: border-box; }
.vt-auth {
    margin: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg);
    color: var(--t1);
    font-family: "Google Sans Flex", Helvetica, Arial, sans-serif; /* jak w panelu (custom.css) */
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
.vt-auth a { color: var(--link); text-decoration: none; }
.vt-auth a:hover, .vt-auth a:focus { color: var(--link-hover); text-decoration: underline; }
.vt-auth :focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.vt-auth h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.vt-auth p { margin: 0; }
.vt-auth svg { flex: none; }
.vt-auth [hidden] { display: none !important; }

/* ---------- prawy górny róg: język i motyw ---------- */
.vt-auth-tools {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 5;
    display: flex;
    gap: 10px;
}
.vt-auth-ctl {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--bd);
    background: var(--card);
    color: var(--t1);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.vt-auth-ctl::-webkit-details-marker { display: none; }
.vt-auth-ctl:hover { border-color: var(--bd2); }
.vt-auth-lang { position: relative; }
.vt-auth-lang[open] .vt-auth-ctl { border-color: var(--link); }
.vt-auth-menu {
    position: absolute;
    top: 46px;
    right: 0;
    width: 230px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 12px;
    border: 1px solid var(--bd);
    background: var(--menu);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}
.vt-auth-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--t1) !important;
    font-size: 14px;
    text-decoration: none !important;
}
.vt-auth-menu a:hover { background: var(--hover); }
.vt-auth-menu li.active a { font-weight: 700; background: var(--hover); }
.vt-auth-menu strong { width: 26px; font-size: 12px; color: var(--t3); }

.vt-auth-seg {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--bd);
    background: var(--card);
}
.vt-auth-seg button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--t2);
    cursor: pointer;
}
.vt-auth-seg button:hover { color: var(--t1); }
.vt-auth-seg button[aria-checked="true"] { background: var(--on); color: var(--on-t); }

/* ---------- środek: logo + karta ---------- */
.vt-auth-main {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 88px 16px 24px;
}
.vt-auth-logo { display: block; line-height: 0; }
.vt-auth-logo img { width: 220px; height: auto; }
.vt-auth-logo .logo-dark { display: none; }
html[data-ui-theme="dark"] .vt-auth-logo .logo-light { display: none; }
html[data-ui-theme="dark"] .vt-auth-logo .logo-dark { display: block; }

.vt-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px;
    border-radius: 18px;
    border: 1px solid var(--card-bd);
    background: var(--card);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.vt-auth-card.is-wide { max-width: 720px; }
.vt-auth-head { display: flex; flex-direction: column; gap: 6px; }
.vt-auth-head.center { text-align: center; }
.vt-auth-head p { font-size: 14px; font-weight: 500; color: var(--t2); }
.vt-auth-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--t2);
}
.vt-auth-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: #E3262A; }

/* ---------- formularz ---------- */
.vt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vt-field > label, .vt-field .vt-label { font-size: 13px; font-weight: 600; color: var(--t1); }
.vt-field .opt { font-weight: 400; color: var(--t3); }
.vt-field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.vt-field-row a { font-size: 13px; font-weight: 600; }
.vt-input {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--bd2);
    background: var(--input);
    transition: border-color .15s, box-shadow .15s;
}
.vt-input:focus-within { border-color: var(--link); box-shadow: 0 0 0 4px var(--ring); }
.vt-input.is-invalid { border-color: var(--err); }
.vt-input input, .vt-input select {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--t1);
    font: inherit;
    font-size: 15px;
    -webkit-appearance: none;
    appearance: none;
}
.vt-input select { cursor: pointer; padding-right: 36px; }
.vt-input.is-select { position: relative; }
.vt-input.is-select::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid var(--t2);
    border-bottom: 2px solid var(--t2);
    transform: rotate(45deg);
    pointer-events: none;
}
.vt-input select option { background: var(--card); color: var(--t1); }
.vt-input input::placeholder { color: var(--t3); }
.vt-input input:disabled { color: var(--t3); }
/* pokaż / ukryj hasło – sama ikona oka, bez tła */
.vt-input-eye {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--t3);
    cursor: pointer;
    transition: color .15s;
}
.vt-input-eye:hover, .vt-input-eye:focus-visible { color: var(--t1); }
.vt-input-eye .i-hide { display: none; }
.vt-input-eye[aria-pressed="true"] .i-show { display: none; }
.vt-input-eye[aria-pressed="true"] .i-hide { display: block; }

/* tło autouzupełniania (inset box-shadow na <input>) nie może wychodzić poza zaokrąglenie pola */
.vt-input { overflow: hidden; }
.vt-input input, .vt-input select { border-radius: 9px; }
/* obwódkę fokusu rysuje cały wiersz pola, nie sam <input> */
.vt-input input:focus-visible, .vt-input select:focus-visible { outline: none; }
/* autouzupełnianie przeglądarki: bez jasnego/niebieskiego tła tylko pod tekstem */
.vt-input input:-webkit-autofill,
.vt-input input:-webkit-autofill:hover,
.vt-input input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--input) inset;
    -webkit-text-fill-color: var(--t1);
    caret-color: var(--t1);
    transition: background-color 9999s ease-out 0s;
}
.vt-hint { font-size: 12px; color: var(--t3); }
.vt-error { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--err-t); }
html:not([data-ui-theme="dark"]) .vt-error { color: var(--err); }
.vt-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.vt-grid-21 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }

.vt-check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--t2); cursor: pointer; }
.vt-check input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    border-radius: 6px;
    border: 1.5px solid var(--bd2);
    background: var(--input);
    -webkit-appearance: none;
    appearance: none;
    display: grid;
    place-content: center;
    cursor: pointer;
}
.vt-check input::before {
    content: "";
    width: 11px;
    height: 6px;
    margin-top: -3px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform .12s;
}
.vt-check input:checked { background: var(--chk); border-color: var(--chk); }
.vt-check input:checked::before { transform: rotate(-45deg) scale(1); }
.vt-check.is-invalid input { border-color: var(--err); }

.vt-sec { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; border-top: 1px solid var(--bd); }
.vt-sec h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.vt-num { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: var(--cta); color: #fff; font-size: 12px; font-weight: 800; }

.vt-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.vt-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--input); border: 1px solid var(--bd); font-size: 13px; color: var(--t2); }
.vt-steps b { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--bd2); font-size: 12px; color: var(--t2); flex: none; }
.vt-steps li[aria-current="step"] { border-color: var(--cta); color: var(--t1); font-weight: 600; }
.vt-steps li[aria-current="step"] b { background: var(--cta); border-color: var(--cta); color: #fff; }

/* ---------- przyciski ---------- */
.vt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    padding: 0 24px;
    border: 0;
    border-radius: 10px;
    background: var(--cta);
    color: #FFFFFF !important;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s;
}
.vt-btn:hover, .vt-btn:focus { background: var(--cta-hover); }
.vt-btn.is-auto { width: auto; }
.vt-btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    border: 1px solid var(--bd2);
    background: transparent;
    color: var(--t1) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
}
.vt-btn-ghost:hover { background: var(--hover); }
.vt-divider { display: flex; align-items: center; gap: 12px; color: var(--t3); font-size: 13px; }
.vt-divider::before, .vt-divider::after { content: ""; flex: 1; height: 1px; background: var(--bd); }
.vt-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 14px; font-weight: 600; }
.vt-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; border-top: 1px solid var(--bd); font-size: 14px; color: var(--t2); }
.vt-foot-row a { font-weight: 600; }

/* ---------- komunikaty ---------- */
.vt-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: 14px; line-height: 1.45; }
.vt-alert svg { margin-top: 2px; }
.vt-alert.is-error { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-t); }
.vt-alert.is-error svg { color: var(--err); }
.vt-alert.is-warning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-t); }
.vt-alert.is-warning svg { color: var(--warn); }
.vt-alert a { color: inherit; font-weight: 700; text-decoration: underline; }

.vt-badge { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 18px; }
.vt-badge.is-ok { background: var(--ok-bg); color: var(--ok); }
.vt-badge.is-warn { background: var(--warn-bg); color: var(--warn); }
.vt-badge.is-err { background: var(--err-bg); color: var(--err); }
.vt-badge.is-info { background: var(--info-bg); color: var(--info); }
.vt-lead { font-size: 15px; line-height: 1.55; color: var(--t2); }
.vt-lead strong { color: var(--t1); }

.vt-meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.vt-meter span { height: 4px; border-radius: 4px; background: var(--meter); transition: background .15s; }
.vt-meter[data-score="1"] span:nth-child(-n+1) { background: var(--err); }
.vt-meter[data-score="2"] span:nth-child(-n+2) { background: var(--warn); }
.vt-meter[data-score="3"] span:nth-child(-n+3),
.vt-meter[data-score="4"] span { background: var(--ok); }
.vt-reqs { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.vt-reqs li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--t3); }
.vt-reqs li::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--bd2); }
.vt-reqs li.is-ok { color: var(--t2); }
.vt-reqs li.is-ok::before { background: var(--ok); }

/* ---------- telefon ---------- */
@media (max-width: 767px) {
    .vt-auth-tools { top: 12px; right: 12px; gap: 8px; }
    .vt-auth-ctl .js-language-flag { display: none; }
    .vt-auth-main { padding: 72px 12px 20px; gap: 18px; justify-content: flex-start; }
    .vt-auth-logo img { width: 180px; }
    .vt-auth-card { padding: 24px 20px; gap: 16px; }
    .vt-auth h1 { font-size: 24px; }
    .vt-input { min-height: 50px; }
    .vt-input input, .vt-input select { font-size: 16px; }
    .vt-grid-2, .vt-grid-21 { grid-template-columns: minmax(0, 1fr); }
    .vt-steps { grid-template-columns: minmax(0, 1fr); }
    .vt-foot-row { flex-direction: column-reverse; align-items: stretch; text-align: center; }
    .vt-foot-row .vt-btn { width: 100%; }
}
