/* =========================================================================
   DIGITLO — DESIGN SYSTEM
   Enterprise Access Control Platform
   Baza: paleta Zinc + akcent Amber (kierunek zachowany z wersji poprzedniej,
   dopracowany do poziomu premium SaaS: Linear / Stripe / Vercel).
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: light;

    /* --- Powierzchnie --- */
    --bg-app: #f4f4f5;
    --bg-subtle: #fafafa;
    --bg-surface: #ffffff;
    --bg-inverse: #18181b;

    /* --- Tekst --- */
    --text-primary: #09090b;
    --text-secondary: #3f3f46;
    --text-muted: #71717a;
    --text-faint: #a1a1aa;
    --text-on-inverse: #fafafa;
    --text-on-inverse-muted: #a1a1aa;

    /* --- Obramowania --- */
    --border-color: #e4e4e7;
    --border-strong: #d4d4d8;
    --border-focus: #18181b;

    /* --- Przyciski / marka ---
       WERSJA TESTOWA: kolor przewodni zmieniony z bursztynu na "technologiczny"
       niebieski. --warning-* poniżej zostają bez zmian celowo — to osobna,
       semantyczna paleta (status "oczekuje"), niezależna od koloru marki. */
    --btn-primary: #18181b;
    --btn-primary-hover: #27272a;
    --brand-accent: #2563eb;
    --brand-accent-hover: #1d4ed8;
    --brand-accent-bright: #3b82f6;
    --brand-accent-soft: #eff6ff;
    --brand-accent-border: #bfdbfe;
    --brand-accent-ring: rgba(37, 99, 235, 0.35);

    /* --- Kolory semantyczne (jedno źródło prawdy dla statusów/alertów) --- */
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #d1fae5;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fee2e2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fef3c7;

    /* --- Cienie (miękkie, warstwowe, niska intensywność — jakość "premium") --- */
    --shadow-xs: 0 1px 2px 0 rgba(24, 24, 27, 0.04);
    --shadow-sm: 0 1px 2px 0 rgba(24, 24, 27, 0.04), 0 1px 1px 0 rgba(24, 24, 27, 0.03);
    --shadow-md: 0 2px 4px -1px rgba(24, 24, 27, 0.04), 0 4px 8px -2px rgba(24, 24, 27, 0.05);
    --shadow-lg: 0 8px 16px -4px rgba(24, 24, 27, 0.06), 0 20px 32px -8px rgba(24, 24, 27, 0.08);
    --shadow-focus: 0 0 0 3px var(--brand-accent-ring);

    /* --- Promienie --- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* --- Ruch --- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 0.15s;
    --dur-base: 0.25s;
}

/* =========================================================================
   1. RESET / BAZA
   ========================================================================= */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01", "ss03", "cv02";
    text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: inherit; }

.ia-table td, .ia-stats {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Dostępność: widoczny pierścień fokusu dla nawigacji klawiaturą,
   bez "obrysowywania" myszką (:focus-visible) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.ia-door-option:focus-within {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* =========================================================================
   2. LOGOTYP (współdzielony: ekran logowania + nagłówek aplikacji)
   ========================================================================= */
.ia-logomark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg-inverse);
    color: var(--brand-accent);
    flex-shrink: 0;
    overflow: hidden;
}
.ia-logomark svg { width: 16px; height: 16px; }
.ia-logomark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-visual .ia-logomark { background: rgba(255, 255, 255, 0.08); color: var(--brand-accent); }

.ia-brand-group { display: flex; align-items: center; gap: 10px; }

/* =========================================================================
   3. UKŁAD LOGOWANIA (SPLIT-SCREEN)
   ========================================================================= */
.auth-body { background: var(--bg-surface); }
.auth-layout { display: flex; min-height: 100vh; }

.auth-visual {
    flex: 1;
    background: linear-gradient(160deg, #0c0c0e 0%, #18181b 55%, #1f1f23 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px;
    color: white;
    position: relative;
    overflow: hidden;
}
/* Subtelna siatka kropek — sugestia "systemu/precyzji" bez cyberpunkowego efektu */
.auth-visual::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: linear-gradient(160deg, black, transparent 75%);
    mask-image: linear-gradient(160deg, black, transparent 75%);
}
.auth-visual::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 50%);
}
.visual-content { position: relative; z-index: 10; max-width: 400px; }
.brand-logo { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.5px; }
.brand-tagline { font-size: 16px; color: #a1a1aa; line-height: 1.55; margin: 20px 0 44px 0; }

.ia-feature-list { display: flex; flex-direction: column; gap: 18px; list-style: none; margin: 0; padding: 0; }
.ia-feature-item { display: flex; align-items: flex-start; gap: 12px; }
.ia-feature-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; align-items: center; justify-content: center; color: var(--brand-accent);
    margin-top: 1px;
}
.ia-feature-icon svg { width: 14px; height: 14px; }
.ia-feature-text { font-size: 13.5px; color: #d4d4d8; line-height: 1.5; padding-top: 4px; }
.ia-feature-text strong { color: #fafafa; font-weight: 600; display: block; font-size: 14px; margin-bottom: 2px; }

.auth-form-container {
    flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg-surface);
}
.auth-form-wrapper { width: 100%; max-width: 380px; }
.auth-form-wrapper .ia-brand-group { display: none; } /* logotyp mobilny, patrz media query */
.auth-form-wrapper h2 { font-size: 24px; font-weight: 700; margin: 0 0 8px 0; letter-spacing: -0.6px; }
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin: 0 0 32px 0; line-height: 1.5; }

@media (max-width: 900px) {
    .auth-visual { display: none; }
    .auth-form-wrapper .ia-brand-group { display: flex; margin-bottom: 32px; }
    .auth-form-wrapper .ia-logomark { background: var(--bg-inverse); color: var(--brand-accent); }
    .auth-form-wrapper .brand-logo { color: var(--text-primary); }
}

/* =========================================================================
   4. UKŁAD APLIKACJI (CANVAS)
   ========================================================================= */
.app-body { background-color: var(--bg-app); min-height: 100vh; }
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    min-height: 64px;
    display: flex;
    flex-wrap: wrap;
    row-gap: 8px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-brand { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-primary); }
/* Kolejność na desktopie: marka | (auto margin) | limit kluczy | akcje — jeden wiersz */
.ia-brand-group { margin-right: auto; }
.header-actions { order: 3; display: flex; gap: 8px; }
.ia-stats {
    order: 2;
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    padding-right: 20px; margin-right: 4px; border-right: 1px solid var(--border-color);
}
.ia-stats b { color: var(--text-primary); font-weight: 600; }

.app-main { padding: 32px; max-width: 1400px; margin: 0 auto; width: 100%; }

.ia-page-heading { margin-bottom: 24px; }
.ia-page-heading h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; margin: 0 0 4px 0; color: var(--text-primary); }
.ia-page-heading p { font-size: 13.5px; color: var(--text-muted); margin: 0; }

.ia-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.sidebar-actions { display: flex; flex-direction: column; gap: 24px; }

/* KARTY */
.ia-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}
.card-header { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.card-header-top { display: flex; align-items: center; gap: 10px; }
.card-header h2, .ia-card-header-toggle h2 {
    margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.2px;
}
.ia-card-subtitle { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.4; }

.ia-section-icon {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    background: var(--bg-subtle); border: 1px solid var(--border-color); color: var(--text-secondary);
}
.ia-section-icon svg { width: 15px; height: 15px; }

.ia-card-header-toggle { display: flex; justify-content: space-between; align-items: center; cursor: pointer; gap: 12px; }
.ia-card-header-toggle .card-header-top { flex: 1; min-width: 0; }
.ia-toggle-icon {
    background: var(--bg-subtle); border: 1px solid var(--border-color); color: var(--text-secondary);
    width: 26px; height: 26px; border-radius: var(--radius-full);
    font-size: 13px; line-height: 1; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.ia-card-header-toggle:hover .ia-toggle-icon { background: var(--border-color); color: var(--text-primary); }

/* =========================================================================
   5. FORMULARZE & KONTROLKI
   ========================================================================= */
.ia-form-group { margin-bottom: 20px; }
.ia-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; color: var(--text-primary); }
.ia-text-warning-label { color: var(--text-primary); }

.ia-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
    outline: none;
}
.ia-input:hover { border-color: var(--border-strong); }
.ia-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.06); }
.ia-input::placeholder { color: var(--text-faint); }

/* Pole z ikoną prefiksową (czysto wizualny wrapper — nie zmienia id/value inputu) */
.ia-field { position: relative; }
.ia-field-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-faint); display: flex; pointer-events: none;
}
.ia-field-icon svg { width: 15px; height: 15px; }
.ia-field .ia-input { padding-left: 38px; }

.ia-password-wrapper { position: relative; }
.ia-password-wrapper .ia-field-icon { z-index: 1; }
.ia-input-password { padding-right: 66px; }
.ia-password-wrapper.ia-field .ia-input-password { padding-left: 38px; }

.ia-pwd-toggle-btn {
    /* Wyśrodkowanie przez inset+margin (bez transform) — global .button:active
       nadpisuje "transform" przez !important; gdyby centrowanie też siedziało
       w transform (translateY), klik powodowałby widoczny "skok" przycisku
       w górę zamiast płynnego, delikatnego zmniejszenia w miejscu. */
    position: absolute; right: 8px; top: 0; bottom: 0; margin: auto 0; height: fit-content;
    background: none; border: none; color: var(--text-muted); font-size: 12px; font-weight: 500;
    cursor: pointer; padding: 7px 10px; border-radius: 6px;
    transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.ia-pwd-toggle-btn:hover { color: var(--text-primary); background: var(--bg-subtle); }
.ia-pwd-toggle-btn:active:not(:disabled) { transform: scale(0.94) !important; }
.ia-btn-link {
    background: none; border: none; color: var(--text-muted); font-size: 12.5px; cursor: pointer;
    padding: 0; font-weight: 500; transition: color var(--dur-fast) ease;
}
.ia-btn-link:hover { color: var(--text-primary); }

/* PRZYCISKI */
.ia-btn-primary {
    width: 100%; background: var(--btn-primary); color: white; border: none; padding: 10px 16px;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
    box-shadow: var(--shadow-xs);
}
.ia-btn-primary:hover:not(:disabled) { background: var(--btn-primary-hover); }
.ia-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.ia-btn-secondary {
    background: white; border: 1px solid var(--border-color); color: var(--text-primary); padding: 10px 16px;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all var(--dur-fast) ease; box-shadow: var(--shadow-xs);
}
.ia-btn-secondary:hover { background: var(--bg-app); border-color: var(--border-strong); }

.ia-btn-ghost {
    background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 10px 16px;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all var(--dur-fast) ease;
}
.ia-btn-ghost:hover { background: var(--bg-app); color: var(--text-primary); }

.ia-btn-sm { padding: 7px 12px; font-size: 13px; }
.ia-btn-block { width: 100%; margin-top: 8px; }

.ia-btn-warning-gradient {
    width: 100%; color: white; border: none; padding: 10px 16px;
    background: linear-gradient(135deg, var(--brand-accent-bright) 0%, var(--brand-accent) 55%, var(--brand-accent-hover) 100%);
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 10px;
    box-shadow: 0 1px 2px rgba(29, 78, 216, 0.3);
    transition: filter var(--dur-fast) ease;
}
.ia-btn-warning-gradient:hover { filter: brightness(1.04); }

/* =========================================================================
   6. TABELE I STATUSY
   ========================================================================= */
.table-container { overflow-x: auto; margin-top: 16px; }
.ia-table { width: 100%; border-collapse: collapse; text-align: left; }
.ia-table th {
    font-size: 11.5px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-color);
    padding: 10px 16px; text-transform: uppercase; letter-spacing: 0.04em;
}
.ia-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); font-size: 14px; color: var(--text-primary); vertical-align: middle; }
.ia-table tr:last-child td { border-bottom: none; }
.ia-table tbody tr { transition: background-color var(--dur-fast) ease; }
.ia-table tbody tr:hover { background-color: var(--bg-subtle); }

.ia-actions-group { display: flex; gap: 6px; }
.ia-text-center { text-align: center; }

/* Statusy — wskaźnik kropkowy jak w Linear/Stripe, dodany czysto przez CSS (::before),
   nie ingeruje w treść ustawianą przez JS */
.ia-status-active, .ia-status-pending, .ia-status-blocked {
    padding: 4px 10px 4px 8px; border-radius: var(--radius-full); font-size: 12px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 6px; line-height: 1.4;
}
.ia-status-active::before, .ia-status-pending::before, .ia-status-blocked::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.ia-status-active { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.ia-status-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.ia-status-blocked { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

/* Przyciski akcji w tabeli — ikony dodane przez ::before (nieusuwalne przez
   JS przy .textContent, bo pseudo-elementy nie są częścią textContent) */
.ia-btn-edit, .ia-btn-warning, .ia-btn-danger {
    padding: 6px 11px; font-size: 12.5px; font-weight: 500; border-radius: var(--radius-sm); cursor: pointer;
    box-shadow: var(--shadow-xs); transition: all var(--dur-fast) ease;
    display: inline-flex; align-items: center; gap: 5px;
}
.ia-btn-edit::before, .ia-btn-warning::before, .ia-btn-danger::before {
    font-size: 12px; line-height: 1; position: relative; top: -0.5px;
}
.ia-btn-edit { background: white; border: 1px solid var(--border-color); color: var(--text-secondary); }
.ia-btn-edit::before { content: '⚙'; }
.ia-btn-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.ia-btn-warning::before { content: '↻'; }
.ia-btn-danger { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.ia-btn-danger::before { content: '✕'; font-size: 11px; }
.ia-btn-edit:hover { background: var(--bg-app); border-color: var(--border-strong); }
.ia-btn-warning:hover { background: #fef3c7; }
.ia-btn-danger:hover { background: #fee2e2; }

/* Stan pusty / ładowania w tabeli */
.ia-empty-msg {
    color: var(--text-muted) !important;
    font-size: 13.5px;
    padding: 40px 16px !important;
    font-weight: 500;
}

/* =========================================================================
   7. ZAMKI, PRZEŁĄCZNIKI & KOLAPSY
   ========================================================================= */
.ia-doors-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 24px 0 12px 0; text-transform: uppercase; letter-spacing: 0.06em; }
.doors-scroll, .ia-scrollable-container { max-height: 220px; overflow-y: auto; margin-bottom: 16px; padding-right: 6px; }

.ia-door-option {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 14px; background: white; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); margin-bottom: 8px;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.ia-door-option:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.ia-door-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 9px; }
.ia-door-name::before {
    content: ''; width: 6px; height: 6px; border-radius: 2px; background: var(--brand-accent); flex-shrink: 0;
}

.ia-switch { position: relative; display: inline-block; width: 34px; height: 20px; flex-shrink: 0; }
.ia-switch input { opacity: 0; width: 0; height: 0; }
.ia-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-strong); transition: .25s var(--ease-out); border-radius: 20px; }
.ia-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .25s var(--ease-out); border-radius: 50%; box-shadow: var(--shadow-sm); }
input:checked + .ia-slider { background-color: var(--text-primary); }
input:checked + .ia-slider:before { transform: translateX(14px); }

.ia-collapsible-content { max-height: 0; overflow: hidden; opacity: 0; transition: all var(--dur-base) var(--ease-out); }
.ia-collapsible-content.is-open { max-height: 800px; opacity: 1; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-color); }

/* =========================================================================
   8. MODALE & KOMUNIKATY
   ========================================================================= */
.ia-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(9, 9, 11, 0.45); backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center; justify-content: center; z-index: 1000;
}
.ia-modal-content {
    background: var(--bg-surface); padding: 28px; border-radius: var(--radius-lg);
    width: 90%; max-width: 440px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-color);
    position: relative;
}
.ia-modal-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ia-modal-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.4px; }
.ia-modal-subtitle { font-size: 13.5px; color: var(--text-muted); margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.ia-modal-subtitle-value { color: var(--text-primary); font-weight: 600; }
.ia-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.ia-modal-actions .ia-btn-primary, .ia-modal-actions .ia-btn-secondary { width: auto; padding-left: 20px; padding-right: 20px; }

.ia-pwd-modal-desc { font-size: 13.5px; color: var(--text-muted); margin: -6px 0 22px 0; line-height: 1.5; }
.ia-mb-20 { margin-bottom: 20px; }

.ia-message-alert { margin-top: 16px; font-size: 13px; display: none; padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 500; line-height: 1.45; }
.ia-msg-error { background-color: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); display: block !important; }
.ia-msg-success { background-color: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); display: block !important; }
.ia-reset-section {
    display: none;
    margin-top: 20px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    animation: revealPanel 0.35s var(--ease-out);
}
@keyframes revealPanel {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.ia-reset-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.ia-reset-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
    background: var(--brand-accent-soft); border: 1px solid var(--brand-accent-border); color: var(--brand-accent-hover);
    display: flex; align-items: center; justify-content: center;
}
.ia-reset-icon svg { width: 14px; height: 14px; }
.ia-reset-header-text strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.ia-reset-header-text p { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.ia-reset-section .ia-form-group { margin-bottom: 14px; }

.ia-pwd-modal-msg { font-size: 13px; margin-bottom: 4px; }
.ia-pwd-modal-msg.ia-msg-error, .ia-pwd-modal-msg.ia-msg-success { margin-top: 0; margin-bottom: 20px; }

.ia-toast-notification {
    position: fixed; bottom: 32px; right: 32px; background: var(--bg-inverse); color: white;
    padding: 14px 20px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 500;
    box-shadow: var(--shadow-lg); z-index: 9999; display: flex; align-items: center; gap: 8px;
    animation: slideUpToast 0.3s var(--ease-out) forwards;
}

@keyframes slideUpToast {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================================================
   9. RESPONSYWNOŚĆ & INTERAKCJE DOTYKOWE
   ========================================================================= */
button:active:not(:disabled), .ia-door-option:active {
    transform: scale(0.97) !important;
    transition: transform 0.1s var(--ease-out);
}

@media (max-width: 1024px) {
    .ia-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app-header {
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(228, 228, 231, 0.6);
    }
    /* Wiersz 1: marka + akcje. Wiersz 2 (pełna szerokość): limit kluczy —
       wcześniej ukrywany całkowicie na telefonie, teraz zawsze widoczny. */
    .ia-brand-group { margin-right: 0; }
    .header-actions { margin-left: auto; }
    .ia-stats {
        order: 3;
        flex-basis: 100%;
        padding-right: 0; margin-right: 0; border-right: none;
        border-top: 1px solid var(--border-color);
        padding-top: 8px; margin-top: 2px;
        font-size: 12px;
    }
    .app-main { padding: 16px; }

    .ia-input { font-size: 16px; padding: 14px 16px; }
    .ia-field .ia-input { padding-left: 40px; }

    .ia-toast-notification {
        left: 16px; right: 16px; bottom: 24px; width: auto; text-align: center; justify-content: center;
    }

    .ia-modal { align-items: flex-end; }
    .ia-modal-content, .ia-pwd-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 32px 24px 40px;
        margin: 0;
        border: none;
        animation: slideUpModal 0.4s var(--ease-out) forwards;
    }
    .ia-modal-content::before {
        content: ''; display: block; width: 40px; height: 5px;
        background: var(--border-color); border-radius: 10px;
        margin: -16px auto 24px auto;
    }

    .ia-table thead { display: none; }
    .ia-table, .ia-table tbody, .ia-table tr, .ia-table td { display: block; width: 100%; }
    .ia-table tr { margin-bottom: 16px; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; background: var(--bg-surface); }

    .ia-table td {
        padding: 8px 0; border: none; display: flex; justify-content: flex-end; align-items: center; position: relative; text-align: right;
    }
    .ia-table td:last-child { padding-bottom: 0; }
    .ia-table td::before {
        position: absolute; left: 0; font-weight: 500; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
    }

    .ia-table td:nth-of-type(1)::before { content: "Osoba:"; }
    .ia-table td:nth-of-type(2)::before { content: "Telefon:"; }
    .ia-table td:nth-of-type(3)::before { content: "Status:"; }
    .ia-table td:nth-of-type(4)::before { content: ""; display: none; }
    .ia-table td.ia-empty-msg::before { display: none !important; content: none !important; }

    .ia-actions-group { flex-direction: column; width: 100%; margin-top: 16px; gap: 8px; }
    .ia-actions-group button { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* =========================================================================
   10. STRONA GŁÓWNA (LANDING / MARKETING)
   Osobna, statyczna strona promująca panel — ten sam system tokenów,
   przestrzeń nazw "mkt-" żeby nie kolidować z klasami aplikacji ("ia-").
   ========================================================================= */
.mkt-body { background: var(--bg-surface); }
.mkt-container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* --- NAV --- */
.mkt-nav {
    position: relative; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 32px; max-width: 1120px; margin: 0 auto;
}
.mkt-nav-cta {
    background: #fff; color: #18181b; font-weight: 600; font-size: 13.5px;
    padding: 9px 18px; border-radius: var(--radius-full); text-decoration: none;
    transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.mkt-nav-cta:hover { background: #f4f4f5; }
.mkt-nav-cta:active { transform: scale(0.96); }

/* --- HERO (ciemna sekcja, spójna z panelem logowania) --- */
.mkt-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, #0c0c0e 0%, #18181b 55%, #1f1f23 100%);
    color: white;
    padding-bottom: 90px;
}
.mkt-hero::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: linear-gradient(180deg, black, transparent 80%);
    mask-image: linear-gradient(180deg, black, transparent 80%);
}
.mkt-hero::after {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 900px; height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2), transparent 60%);
}
.mkt-hero-inner { position: relative; z-index: 10; text-align: center; padding: 40px 32px 0; max-width: 760px; margin: 0 auto; }
.mkt-hero h1 { font-size: 44px; line-height: 1.15; font-weight: 700; letter-spacing: -1.2px; margin: 0 0 20px 0; }
.mkt-hero-sub { font-size: 17px; color: #d4d4d8; line-height: 1.6; max-width: 540px; margin: 0 auto 32px auto; }
.mkt-hero-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 64px; }

.mkt-btn-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--brand-accent); color: #ffffff; font-weight: 600; font-size: 14.5px;
    padding: 13px 26px; border-radius: var(--radius-sm); text-decoration: none; border: none; cursor: pointer;
    transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.mkt-btn-cta:hover { background: var(--brand-accent-hover); }
.mkt-btn-cta:active { transform: scale(0.97); }

.mkt-btn-ghost-dark {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.06); color: #fafafa; font-weight: 500; font-size: 14.5px;
    padding: 13px 24px; border-radius: var(--radius-sm); text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.mkt-btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.24); }

/* --- Podgląd produktu unoszący się nad linią cięcia hero --- */
.mkt-preview-wrap { position: relative; z-index: 10; max-width: 480px; margin: 0 auto; padding: 0 32px; }
.mkt-preview-card {
    background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color); overflow: hidden; text-align: left;
}
.mkt-preview-header { display: flex; align-items: center; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--border-color); }
.mkt-preview-dot { width: 8px; height: 8px; border-radius: 50%; }
.mkt-dot-red { background: #f87171; }
.mkt-dot-amber { background: #fbbf24; }
.mkt-dot-green { background: #4ade80; }
.mkt-preview-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-left: 8px; }
.mkt-preview-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--border-color); }
.mkt-preview-row:last-child { border-bottom: none; }
.mkt-preview-name { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }

/* --- Sekcje na jasnym tle --- */
.mkt-section { padding: 90px 32px; }
.mkt-section-tight { padding-top: 0; }
.mkt-section-heading { text-align: center; max-width: 560px; margin: 0 auto 48px auto; }
.mkt-section-heading h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.6px; margin: 0 0 12px 0; color: var(--text-primary); }
.mkt-section-heading p { font-size: 15px; color: var(--text-muted); line-height: 1.55; margin: 0; }

.mkt-feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 900px; margin: 0 auto; }
.mkt-feature-card {
    background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    padding: 26px; box-shadow: var(--shadow-sm);
}
.mkt-feature-icon {
    width: 38px; height: 38px; border-radius: 10px; background: var(--bg-subtle); border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center; color: var(--text-primary); margin-bottom: 16px;
}
.mkt-feature-icon svg { width: 18px; height: 18px; }
.mkt-feature-card h3 { font-size: 15.5px; font-weight: 600; margin: 0 0 6px 0; letter-spacing: -0.2px; }
.mkt-feature-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin: 0; }

/* --- Jak to działa --- */
.mkt-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: 900px; margin: 0 auto; counter-reset: mkt-step; }
.mkt-step { text-align: left; position: relative; padding-top: 44px; }
.mkt-step::before {
    counter-increment: mkt-step; content: counter(mkt-step);
    position: absolute; top: 0; left: 0; width: 32px; height: 32px; border-radius: 9px;
    background: var(--bg-inverse); color: var(--brand-accent); font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.mkt-step h3 { font-size: 14.5px; font-weight: 600; margin: 0 0 6px 0; }
.mkt-step p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin: 0; }

/* --- Pasek CTA --- */
.mkt-cta-band {
    max-width: 900px; margin: 0 auto; padding: 48px 40px; text-align: center;
    background: var(--bg-inverse); border-radius: var(--radius-lg); color: white;
    position: relative; overflow: hidden;
}
.mkt-cta-band::after {
    content: ''; position: absolute; top: -40%; right: -10%; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2), transparent 65%);
}
.mkt-cta-band-inner { position: relative; z-index: 2; }
.mkt-cta-band h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; margin: 0 0 10px 0; }
.mkt-cta-band p { font-size: 14.5px; color: #a1a1aa; margin: 0 0 26px 0; }

/* --- Stopka --- */
.mkt-footer { border-top: 1px solid var(--border-color); padding: 32px; }
.mkt-footer-inner {
    max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.mkt-footer-brand { display: flex; align-items: center; gap: 10px; }
.mkt-footer-tagline { font-size: 12.5px; color: var(--text-muted); }
.mkt-footer-links { display: flex; align-items: center; gap: 20px; font-size: 13px; }
.mkt-footer-links a { color: var(--text-muted); text-decoration: none; }
.mkt-footer-links a:hover { color: var(--text-primary); }
.mkt-footer-copy { font-size: 12px; color: var(--text-faint); width: 100%; text-align: center; margin-top: 20px; }

@media (max-width: 860px) {
    .mkt-feature-grid { grid-template-columns: 1fr; }
    .mkt-steps { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 640px) {
    .mkt-nav { padding: 20px 20px; }
    .mkt-hero-inner { padding: 32px 20px 0; }
    .mkt-hero h1 { font-size: 32px; letter-spacing: -0.8px; }
    .mkt-hero-sub { font-size: 15px; }
    .mkt-section { padding: 64px 20px; }
    .mkt-preview-wrap { padding: 0 20px; }
    .mkt-cta-band { padding: 36px 24px; margin: 0 20px; }
    .mkt-footer-inner { flex-direction: column; align-items: flex-start; }
}
