/* ============================================================================
   login.css — style wyniesione z login.html (04.09.2026)
   ----------------------------------------------------------------------------
   Treść przeniesiona BEZ ZMIAN. <link> stoi dokładnie w miejscu dawnego
   <style>, więc kolejność kaskady jest zachowana.

   Kolory i wymiary bierz z css/tokens.css przez var(--nazwa).
   Patrz STANDARD-WYGLADU.md.
   ========================================================================= */

    /* ── Marka platformy Connect (apple-design 2026-09-25) ──
       Logowanie to powierzchnia PLATFORMY, nie organizacji — kolor ze znaku
       Connect (#7B4BBE), zgodnie z zasadą dwóch zakresów marki (Connect Aurora).
       Wcześniej fioletowe logo stało nad niebieskim przyciskiem.
       Motyw idzie za ustawieniem systemu (niżej: prefers-color-scheme). */
    :root {
      color-scheme: light dark;
      --primary: #7B4BBE;
      --primary-hover: #6A3DA8;
      --primary-rgb: 123, 75, 190;
      --primary-light: rgba(123,75,190,0.10);
      --primary-ring: rgba(123,75,190,0.24);
      --login-on-primary: #ffffff;
      --login-label: #374151;
      --login-success-text: #166534;
      --danger-bg: rgba(220,38,38,0.07);
      --radius-sm: 10px;
      --radius-lg: 18px;
      --radius-full: 9999px;
      --ease: 0.15s ease;
      --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      --z-toast: 9999;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      min-height: 100dvh;
      padding: 1.5rem 1rem;
    }

    .login-container { width: 100%; max-width: 420px; }

    /* ── Logo ── */
    .logo-container {
      text-align: center;
      margin-bottom: 1.75rem;
    }
    .logo-container img {
      width: 278px;
      height: auto;
    }

    /* ── Card ── */
    .card {
      background: var(--card);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      padding: 2rem 2rem 1.75rem;
      border: 1px solid rgba(var(--primary-rgb),0.08);
    }

    h2 { font-weight: 700; font-size: 1.6rem; margin-bottom: 0.35rem; color: var(--text); letter-spacing: var(--tracking-display); line-height: 1.2; }
    p.subtitle { color: var(--muted); margin-bottom: 1.75rem; font-size: var(--fs-15); }

    .form-group { margin-bottom: 1.1rem; }

    label { display: block; margin-bottom: 0.45rem; font-weight: 600; font-size: var(--fs-14); color: var(--login-label); }

    input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select {
      width: 100%;
      padding: 0.75rem 0.9rem;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-sm);
      font-size: var(--fs-16);
      background: var(--field-bg);
      color: var(--text);
      font-family: var(--font);
      transition: border-color var(--ease), box-shadow var(--ease);
    }
    input[type="checkbox"] { width: auto; accent-color: var(--primary); }
    input:focus, select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: var(--focus-ring);
      background: var(--card);
    }

    .btn-primary {
      background: var(--primary);
      color: var(--login-on-primary);
      padding: 0.8rem 1.5rem;
      border: none;
      border-radius: var(--radius-sm);
      font-size: var(--fs-16);
      font-weight: 600;
      cursor: pointer;
      transition: background-color var(--ease), transform var(--dur-press);
      width: 100%;
      margin-top: 0.75rem;
      font-family: var(--font);
    }
    .btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
    .btn-primary:active:not(:disabled) { transform: scale(0.97); transition-duration: var(--dur-press); }
    .btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

    /* ── Remember me ── */
    .remember-me-label {
      display: flex; align-items: center; gap: 0.6rem; cursor: pointer;
      padding: 0.65rem 0.9rem; border-radius: var(--radius-sm);
      border: 1.5px solid var(--border); background: var(--field-bg);
      transition: border-color var(--ease), box-shadow var(--ease);
      margin-bottom: 0; font-weight: normal;
    }
    .remember-me-label:hover { border-color: var(--primary); box-shadow: var(--focus-ring); }
    .remember-me-checkbox { flex-shrink: 0; width: 1rem; height: 1rem; accent-color: var(--primary); cursor: pointer; }
    .remember-me-title { font-size: var(--fs-14); font-weight: 600; color: var(--text); }

    /* ── Akceptacja Regulaminu / Polityki Prywatności (rejestracja) ── */
    .reg-terms-label {
      display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer;
      padding: 0.65rem 0.9rem; border-radius: var(--radius-sm);
      border: 1.5px solid var(--border); background: var(--field-bg);
      transition: border-color var(--ease), box-shadow var(--ease);
      margin-bottom: 0; font-weight: normal;
    }
    .reg-terms-label:hover { border-color: var(--primary); box-shadow: var(--focus-ring); }
    .reg-terms-checkbox { flex-shrink: 0; width: 1rem; height: 1rem; margin-top: 0.15rem; accent-color: var(--primary); cursor: pointer; }
    .reg-terms-title { font-size: var(--fs-14); color: var(--text); line-height: 1.5; }
    .reg-terms-title a { color: var(--primary); font-weight: 600; text-decoration: none; }
    .reg-terms-title a:hover { text-decoration: underline; }

    /* ── OTP inputs ── */
    .otp-inputs {
      display: flex; align-items: center; justify-content: center;
      gap: 0.5rem; margin: 2rem 0 0.75rem;
    }
    .otp-digit {
      width: 48px; height: 58px; text-align: center;
      font-size: var(--fs-24); font-weight: 700; font-family: var(--font);
      border: 2px solid var(--border); border-radius: var(--radius-sm);
      background: var(--field-bg); color: var(--text);
      transition: border-color var(--ease), box-shadow var(--ease);
      caret-color: var(--primary);
    }
    .otp-digit:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); background: var(--card); }
    .otp-digit.filled { border-color: var(--primary); }
    .otp-digit.error-digit { border-color: var(--danger); animation: shake .35s ease; }
    .otp-sep { width: 12px; height: 2px; background: var(--border); border-radius: 2px; flex-shrink: 0; }
    @keyframes shake {
      0%,100% { transform: translateX(0); }
      20%,60%  { transform: translateX(-5px); }
      40%,80%  { transform: translateX(5px); }
    }
    .otp-timer { text-align: center; font-size: var(--fs-13); color: var(--muted); margin-bottom: 1rem; min-height: 1.2em; }
    .otp-back {
      display: inline-flex; align-items: center; gap: 4px;
      background: none; border: none; color: var(--muted); cursor: pointer;
      font-size: var(--fs-14); font-family: var(--font); padding: 0;
      margin-bottom: 1.25rem; transition: color var(--ease);
    }
    .otp-back:hover { color: var(--primary); }

    /* ── Logowanie kodem QR ── */
    .qr-instructions {
        margin: 0 0 1.1rem; padding-left: 1.2rem; font-size: var(--fs-13); color: var(--muted); line-height: 1.6;
    }
    .qr-instructions li { margin-bottom: 0.3rem; }

    /* Linia czasu logowania */
    .qr-timeline { display: flex; align-items: center; justify-content: center; gap: 0; margin: 0.25rem 0 1.25rem; }
    .qr-tl-step { display: flex; flex-direction: column; align-items: center; gap: 5px; }
    .qr-tl-num {
        width: 26px; height: 26px; border-radius: 50%; background: var(--field-bg); border: 1.5px solid var(--border);
        display: flex; align-items: center; justify-content: center; font-size: var(--fs-13); font-weight: 700; color: var(--muted);
        transition: background-color var(--ease), border-color var(--ease), color var(--ease);
    }
    .qr-tl-label { font-size: var(--fs-11); color: var(--muted); font-weight: 600; }
    .qr-tl-connector { width: 32px; height: 2px; background: var(--border); margin: 0 4px 18px; }
    .qr-tl-step.active .qr-tl-num { background: var(--primary); border-color: var(--primary); color: #fff; }
    .qr-tl-step.active .qr-tl-label { color: var(--primary); }
    .qr-tl-step.done .qr-tl-num { background: var(--success); border-color: var(--success); color: #fff; }
    .qr-tl-step.done .qr-tl-label { color: var(--success); }

    /* Scena: QR <-> kod dopasowania w tym samym miejscu */
    .qr-stage { min-height: 250px; display: flex; align-items: center; justify-content: center; }
    .qr-stage-face { width: 100%; animation: qrFaceIn 0.3s ease both; }
    @keyframes qrFaceIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
    .qr-image-wrap {
        display: flex; justify-content: center; margin: 0 0 0.25rem;
        padding: 14px; background: #fff; border: 1.5px solid var(--primary-ring); border-radius: var(--radius-sm);
        box-shadow: 0 0 0 4px var(--primary-light);
        animation: qrPulse 2.4s ease-in-out infinite;
    }
    @keyframes qrPulse {
        0%, 100% { box-shadow: 0 0 0 4px var(--primary-light); }
        50% { box-shadow: 0 0 0 8px transparent; }
    }
    .qr-image-wrap img { width: 220px; height: 220px; display: block; }
    .qr-code-label { text-align: center; font-size: var(--fs-14); color: var(--muted); margin-bottom: 0.5rem; }

    /* Karta kodu weryfikacyjnego — mocno wyeksponowana, żeby nie dało się jej przeoczyć */
    .qr-code-card {
        background: linear-gradient(160deg, var(--primary-light) 0%, var(--card) 100%);
        border: 2px solid var(--primary); border-radius: var(--radius-lg);
        padding: 1.1rem 1.25rem 1rem; text-align: center;
        box-shadow: var(--shadow-md);
        animation: qrCodeCardIn 0.35s cubic-bezier(0.34,1.35,0.64,1) both;
    }
    @keyframes qrCodeCardIn {
        from { opacity: 0; transform: scale(0.9); }
        to   { opacity: 1; transform: scale(1); }
    }
    .qr-code-badge {
        display: inline-block; background: var(--primary); color: #fff;
        font-size: var(--fs-11); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
        padding: 0.25rem 0.7rem; border-radius: var(--radius-full); margin-bottom: 0.6rem;
    }
    .qr-match-code {
        text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        font-size: var(--fs-48); font-weight: 800; letter-spacing: 0.22em; color: var(--primary);
        margin-bottom: 0.6rem; min-height: 3.4rem; text-shadow: 0 1px 0 rgba(255,255,255,0.6);
    }
    .qr-code-timer {
        display: flex; align-items: center; justify-content: center; gap: 0.5rem;
        font-size: var(--fs-12); color: var(--muted);
    }
    .qr-code-timer-track {
        width: 70px; height: 5px; border-radius: var(--radius-xs); background: rgba(var(--primary-rgb),0.15); overflow: hidden;
    }
    .qr-code-timer-fill {
        height: 100%; background: var(--primary); border-radius: var(--radius-xs); width: 100%;
        transition: width 1s linear;
    }
    .qr-code-timer-fill.is-low { background: var(--warning); }

    /* Komunikat statusu — neutralny/sukces/błąd */
    .qr-status-msg {
        text-align: center; font-size: var(--fs-14); color: var(--muted); min-height: 1.3rem;
        margin-bottom: 1.1rem; transition: color var(--ease);
    }
    .qr-status-msg.is-scanned { color: var(--login-success-text); font-weight: 600; }
    .qr-status-msg.is-error { color: var(--danger); font-weight: 600; }

    /* ── Stay logged in ── */
    .stay-icon { text-align: center; margin-bottom: 1rem; }
    .btn-secondary {
      width: 100%; padding: 0.8rem 1.5rem; margin-top: 0.75rem;
      border: 1.5px solid var(--border); border-radius: var(--radius-sm);
      background: transparent; color: var(--text); font-size: var(--fs-15);
      font-weight: 500; cursor: pointer; font-family: var(--font);
      transition: border-color var(--ease), background var(--ease);
    }
    .btn-secondary:hover { border-color: var(--primary); background: var(--primary-light); }

    .link-btn {
      background: none; border: none; color: var(--primary); cursor: pointer;
      font-size: inherit; font-family: var(--font); font-weight: 600; padding: 0;
      text-decoration: none;
    }
    .link-btn:hover { text-decoration: underline; }
    .link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

    .footer-note { margin-top: 1.25rem; font-size: var(--fs-14); color: var(--muted); text-align: center; }
    .link { color: var(--primary); text-decoration: none; font-weight: 600; }
    .link:hover { text-decoration: underline; }

    .error {
      color: var(--danger);
      background-color: var(--danger-bg);
      border: 1px solid rgba(220,38,38,0.18);
      padding: 0.75rem; border-radius: var(--radius-sm);
      margin-top: 1.25rem; text-align: center; font-size: var(--fs-14); display: none;
    }
    .field-hint { margin-top: 0.4rem; font-size: var(--fs-13); color: var(--muted); }
    .field-hint.error { color: var(--danger); background: none; border: none; padding: 0; }
    .field-hint.success { color: var(--login-success-text); }

    .status-badge {
      position: fixed; top: 12px; right: 12px; z-index: var(--z-toast);
      color: var(--login-success-text);
      background-color: rgba(22,163,74,0.12);
      border: 1px solid rgba(22,163,74,0.35);
      padding: 0.45rem 0.9rem; border-radius: var(--radius-full);
      font-size: var(--fs-14); font-weight: 600; display: none;
      box-shadow: var(--shadow-lg);
      max-width: calc(100vw - 24px);
      text-overflow: ellipsis; white-space: nowrap; overflow: hidden; pointer-events: none;
    }

    .section { display: none; }
    .section.active { display: block; }

    /* ── 2-kolumnowy formularz rejestracji (desktop) ── */
    .login-container.is-register { max-width: 700px; }

    /* ── Kompaktowy układ zakładki logowania kodem QR — całość musi mieścić się
       w oknie przeglądarki bez przewijania, to pierwszy ekran nowego użytkownika ── */
    .login-container.is-qr .logo-container { margin-bottom: 0.6rem; }
    .login-container.is-qr .logo-container img { width: 130px; }
    .login-container.is-qr .card {
      padding: 1.35rem 1.75rem;
      max-height: calc(100dvh - 2rem);
      overflow-y: auto;
    }

    #qrSection .otp-back { margin-bottom: 0.5rem; }
    #qrSection h2 { font-size: var(--fs-22); margin-bottom: 0.25rem; }
    #qrSection .subtitle { margin-bottom: 1rem; font-size: var(--fs-14); }

    #qrSection .qr-timeline { margin: 0 0 0.75rem; }
    #qrSection .qr-tl-num { width: 22px; height: 22px; font-size: var(--fs-12); }
    #qrSection .qr-tl-label { font-size: 0.64rem; }
    #qrSection .qr-tl-connector { margin: 0 4px 14px; }

    #qrSection .qr-stage { min-height: 190px; }
    #qrSection .qr-image-wrap { padding: 10px; }
    #qrSection .qr-image-wrap img { width: 170px; height: 170px; }

    #qrSection .qr-code-card { padding: 0.9rem 1.1rem 0.85rem; }
    #qrSection .qr-match-code { font-size: 2.3rem; min-height: 2.6rem; margin-bottom: 0.45rem; }

    #qrSection .qr-status-msg { margin-bottom: 0.75rem; }

    #qrSection .qr-instructions { margin: 0; padding-left: 1.1rem; font-size: var(--fs-12); line-height: 1.5; }
    #qrSection .qr-instructions li { margin-bottom: 0.2rem; }

    /* Bezpiecznik dla bardzo niskich okien (np. telefon w poziomie) */
    @media (max-height: 620px) {
      .login-container.is-qr .logo-container { display: none; }
      .login-container.is-qr .card { padding: 0.85rem 1.5rem; }
      #qrSection h2 { font-size: var(--fs-18); margin-bottom: 0.15rem; }
      #qrSection .subtitle { display: none; }
      #qrSection .qr-timeline { margin: 0 0 0.5rem; }
      #qrSection .qr-tl-connector { margin: 0 4px 10px; }
      #qrSection .qr-stage { min-height: 120px; }
      #qrSection .qr-image-wrap { padding: 6px; }
      #qrSection .qr-image-wrap img { width: 100px; height: 100px; }
      #qrSection .qr-status-msg { margin-bottom: 0.5rem; }
      #qrSection .qr-instructions { display: none; }
    }

    @media (min-width: 560px) {
      .reg-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 1.25rem;
      }
      .reg-grid .form-group--full {
        grid-column: 1 / -1;
      }
    }

    /* ── Stopka ── */
    .page-footer {
      text-align: center;
      margin-top: 1.5rem;
      font-size: var(--fs-13);
      color: var(--text-3);
    }

    /* ── Baner informacyjny ── */
    @keyframes bannerIn {
      from { opacity: 0; transform: translateY(-10px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .info-banner {
      position: relative;
      background: linear-gradient(135deg, var(--info-bg) 0%, var(--success-bg) 100%);
      border: 1.5px solid rgba(var(--primary-rgb),0.18);
      border-left: 4px solid var(--primary);
      border-radius: var(--radius-lg);
      padding: 1rem 2.75rem 1rem 1.1rem;
      margin-bottom: 1.1rem;
      animation: bannerIn 0.4s ease both;
      box-shadow: var(--shadow-md);
    }
    .info-banner-header {
      display: flex;
      align-items: center;
      gap: 0.55rem;
      margin-bottom: 0.35rem;
    }
    .info-banner-icon {
      flex-shrink: 0;
      width: 22px; height: 22px;
      background: var(--primary);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
    }
    .info-banner-title {
      font-weight: 700;
      font-size: var(--fs-14);
      color: var(--primary);
      letter-spacing: -0.01em;
    }
    .info-banner-body {
      font-size: var(--fs-13);
      color: var(--login-label);
      line-height: 1.55;
    }
    .info-banner-body strong { color: var(--text); }
    .info-banner-tip {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      margin-top: 0.6rem;
      background: rgba(var(--primary-rgb),0.08);
      border-radius: var(--radius-6);
      padding: 0.3rem 0.65rem;
      font-size: var(--fs-13);
      font-weight: 600;
      color: var(--primary);
    }
    .info-banner-close {
      position: absolute;
      top: 0.7rem; right: 0.75rem;
      background: none; border: none;
      color: var(--text-3); cursor: pointer;
      padding: 4px; border-radius: var(--radius-6);
      line-height: 1; transition: color var(--ease), background var(--ease);
      display: flex; align-items: center; justify-content: center;
    }
    .info-banner-close:hover { color: var(--text); background: rgba(0,0,0,0.06); }
    /* ── Modal konserwacji ── */
    @keyframes maintIn {
      from { opacity: 0; transform: translateY(18px) scale(0.96); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes maintDot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%       { opacity: 0.35; transform: scale(0.8); }
    }
    .maint-overlay {
      position: fixed; inset: 0;
      background: rgba(15,23,42,0.72);
      backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
      z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px;
      opacity: 0; pointer-events: none; transition: opacity var(--dur-sheet) ease;
    }
    .maint-overlay.open { opacity: 1; pointer-events: auto; }
    .maint-modal {
      background: color-mix(in srgb, var(--card) 96%, transparent);
      backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
      border-radius: var(--radius-lg);
      max-width: 400px; width: 100%;
      box-shadow: 0 0 0 1px rgba(var(--primary-rgb),0.1), var(--shadow-xl);
      border: 1px solid rgba(255,255,255,0.85);
      overflow: hidden;
      animation: maintIn 0.38s cubic-bezier(0.34,1.35,0.64,1) both;
    }
    .maint-logo-area {
      padding: 1.75rem 2rem 1.5rem;
      text-align: center;
      border-bottom: 1px solid var(--border);
    }
    .maint-logo-area img { width: 278px; height: auto; }
    .maint-content { padding: 1.6rem 2rem 1.9rem; text-align: center; }
    .maint-heading {
      font-size: var(--fs-18); font-weight: 800;
      color: var(--text); margin-bottom: 1rem;
      letter-spacing: -0.02em; white-space: nowrap;
    }
    .maint-body { font-size: var(--fs-14); color: var(--muted); line-height: 1.65; margin: 0 0 1rem; }
    .maint-sign { font-size: var(--fs-14); color: var(--muted); line-height: 1.6; margin: 0 0 1.75rem; }
    .maint-sign strong { color: var(--text); font-weight: 700; }
    .maint-btn {
      display: block; width: 100%;
      padding: 0.8rem 1.5rem;
      background: var(--primary); color: #fff;
      border-radius: var(--radius-sm);
      font-weight: 600; font-size: var(--fs-16);
      border: none; cursor: pointer; font-family: var(--font);
      transition: background-color var(--ease), transform var(--dur-press);
    }
    .maint-btn:hover { background: var(--primary-hover); }
    .maint-btn:active { transform: scale(0.97); }

    /* ── Ekran automatycznego logowania ── */
    @keyframes alSpin {
      to { transform: rotate(360deg); }
    }
    @keyframes alFadeUp {
      from { opacity: 0; transform: translateY(20px) scale(0.97); }
      to   { opacity: 1; transform: translateY(0)   scale(1); }
    }
    #autoLoginOverlay {
      position: fixed; inset: 0;
      background: var(--bg);
      z-index: 8500;
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none;
      transition: opacity var(--dur-ui) ease;
    }
    #autoLoginOverlay.visible { opacity: 1; pointer-events: auto; }
    .al-card {
      display: flex; flex-direction: column; align-items: center; gap: 1.4rem;
      animation: alFadeUp 0.38s cubic-bezier(0.34,1.2,0.64,1) both;
    }
    .al-logo { width: 220px; height: auto; }
    .al-spinner {
      width: 48px; height: 48px;
      border: 3.5px solid rgba(var(--primary-rgb),0.15);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: alSpin 0.75s linear infinite;
    }
    .al-title {
      font-size: var(--fs-17); font-weight: 700; color: var(--text);
      letter-spacing: -0.01em; text-align: center;
    }
    .al-sub {
      font-size: var(--fs-14); color: var(--muted);
      margin-top: -0.85rem; text-align: center;
      transition: opacity var(--dur-fast) ease;
    }
  
/* ============================================================================
   APPLE-DESIGN · 25.09.2026
   ========================================================================= */

/* ── Tryb ciemny wg ustawienia systemu (dotąd wymuszony jasny) ──
   Jaśniejszy fiolet: linki 5,2:1 na karcie, przycisk z ciemnym tekstem 5,7:1. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015; --card: #171a21; --surface-2: #1e222b; --field-bg: #1b1f27;
    --text: #e7e9ee; --muted: #9aa3b2; --text-2: #9aa3b2; --text-3: #6d7686;
    --border: #2a2f3a; --border-soft: #222630; --border-strong: #3a4150;
    --danger: #f87171; --success: #4ade80; --warning: #fbbf24;
    --danger-bg: rgba(248,113,113,0.10); --success-bg: #14241a; --info-bg: #0f1f38; --warning-bg: #2a2306;
    --primary: #9D7BDB; --primary-hover: #B094E4; --primary-rgb: 157, 123, 219;
    --primary-light: rgba(157,123,219,0.14); --primary-ring: rgba(157,123,219,0.30);
    --login-on-primary: #120a1f; --login-label: #cbd2dc; --login-success-text: #4ade80;
    --shadow-rgb: var(--shadow-rgb-dark); --shadow-k: var(--shadow-k-dark);
  }
  .card { box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, var(--shadow-lg); border-color: var(--border); }
  .btn-primary:disabled { background: var(--border-strong); color: var(--muted); }
  .qr-match-code { text-shadow: none; }
  .info-banner-close:hover { background: rgba(255,255,255,0.08); }
  /* logo ma ciemny napis — delikatna jasna podkładka, żeby był czytelny */
  .logo-container img, .al-logo, .maint-logo-area img { filter: brightness(1.35) saturate(1.1); }
}

/* ── Pole wyboru w kolorze marki, 20 px — łatwiej trafić palcem ── */
input.remember-me-checkbox,
input.reg-terms-checkbox {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 0;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-6);
  background: var(--card) center / 14px 14px no-repeat;
  display: inline-grid; place-content: center;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
input.remember-me-checkbox:checked,
input.reg-terms-checkbox:checked {
  background-color: var(--primary); border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  input.remember-me-checkbox:checked,
  input.reg-terms-checkbox:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23120a1f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  }
}
.remember-me-checkbox:active, .reg-terms-checkbox:active { transform: scale(0.9); }
.remember-me-checkbox:focus-visible, .reg-terms-checkbox:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.remember-me-label, .reg-terms-label { min-height: 44px; }
@media (hover: none) {
  .remember-me-label:hover, .reg-terms-label:hover { border-color: var(--border); box-shadow: none; }
}

/* ── Pokaż / ukryj hasło ── */
.pw-field { position: relative; }
.pw-field input { padding-right: 3rem !important; }
.pw-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--muted); cursor: pointer;
  border-radius: var(--radius-sm);
}
.pw-toggle:active { transform: translateY(-50%) scale(0.92); }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (hover: hover) { .pw-toggle:hover { color: var(--text); background: var(--surface-2); } }
.pw-toggle .pw-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .pw-eye { display: none; }
.pw-toggle[aria-pressed="true"] .pw-eye-off { display: block; }

/* ── Kroki logowania: dalej = z prawej, wstecz = z lewej ── */
@keyframes lg-step-fwd  { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes lg-step-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.login-container[data-step-dir="forward"] .section.active { animation: lg-step-fwd 0.4s var(--spring) backwards; }
.login-container[data-step-dir="back"] .section.active    { animation: lg-step-back 0.4s var(--spring) backwards; }
.card { overflow: hidden; }
.login-container.is-qr .card { overflow-y: auto; }

/* Linki pomocnicze: pole dotyku co najmniej 44 px wysokości */
.footer-note .link, .footer-note .link-btn { display: inline-block; padding: 12px 2px; margin: -12px 0; }

/* ── Ograniczenie ruchu: bez przesunięć i pętli, same przenikania ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-iteration-count: 1 !important; }
  .login-container[data-step-dir] .section.active { animation-name: cf-fade !important; animation-duration: var(--dur-fast) !important; }
  .otp-digit.error-digit { animation: none; }
  .qr-image-wrap { animation: none; }
  .al-card, .maint-modal, .qr-code-card, .qr-stage-face, .info-banner { animation-name: cf-fade !important; }
  .al-spinner { animation-duration: 1.6s; animation-iteration-count: infinite !important; }
  .btn-primary:active:not(:disabled), .maint-btn:active, .remember-me-checkbox:active { transform: none; }
}
@keyframes cf-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-transparency: reduce) {
  .maint-overlay, .maint-modal { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .maint-modal { background: var(--card); }
}
