/* ============================================================
   css/style.css – 5OPAR™  |  Single source of truth
   ============================================================ */

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

/* ── Zmienne brandingowe ─────────────────────────────────── */
:root {
    --brand:        #FE5928;   /* 5OPAR™ orange – primary */
    --brand-hover:  #D94420;   /* -10% jasności */
    --brand-ring:   rgba(254, 89, 40, 0.18);

    --txt-primary:  rgb(28, 28, 28);
    --txt-secondary:rgb(53, 53, 53);

    --border:       #B8B8B8;
    --border-light: rgb(226, 226, 226);

    --bg-page:      #F8F8F8;
    --bg-card:      #FFFFFF;

    --success:      #10B981;
    --error:        #D94420;

    --radius:       12px;
    --shadow:       0 4px 24px rgba(254, 89, 40, 0.08);
    --ease:         .2s ease;

    /* Aliasy dla kompatybilności wstecznej */
    --clr-danger:   #D94420;
    --clr-muted:    rgb(120, 120, 120);
    --clr-text:     rgb(28, 28, 28);
}

/* ── Base ────────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--txt-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 4rem;
    line-height: 1.6;
}

a            { color: var(--brand); }
a:hover      { color: var(--brand-hover); }

/* ── TopRightBadge ───────────────────────────────────────── */
.top-right-badge {
    position: fixed;
    top: 28px; right: 32px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 14px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    text-align: center;
    min-width: 130px;
}
.top-right-badge .trb-label {
    font-size: .68rem;
    font-weight: 600;
    color: var(--txt-secondary);
    text-transform: uppercase;
    letter-spacing: .6px;
    line-height: 1;
}
.top-right-badge .trb-logo {
    width: 190px; height: 190px;
    object-fit: contain;
    display: block;
}
@media (max-width: 900px) {
    .top-right-badge {
        position: static;
        margin: 0 auto 1.25rem;
        flex-direction: row;
        min-width: unset;
        padding: 8px 14px;
        gap: 10px;
        max-width: 680px;
        width: 100%;
        justify-content: center;
    }
    .top-right-badge .trb-logo { width: 80px; height: 80px; }
}

/* ── App header ──────────────────────────────────────────── */
.app-header {
    width: 100%; max-width: 680px;
    text-align: center;
    margin-bottom: 2rem;
}
.app-header .logo {
    font-size: 1.6rem; font-weight: 800;
    color: var(--brand);
    letter-spacing: -.5px;
}
.app-header .subtitle {
    color: var(--txt-secondary);
    font-size: .9rem; margin-top: .25rem;
}

/* ── Stepper ─────────────────────────────────────────────── */
.progress-bar {
    width: 100%; max-width: 680px;
    display: flex; gap: .5rem;
    margin-bottom: 2rem;
    align-items: center;
}
.progress-step {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; gap: .3rem;
}

/* Krok nieaktywny */
.step-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
    color: var(--txt-secondary);
    transition: var(--ease);
}
/* Krok aktywny */
.progress-step.active .step-dot {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
/* Krok ukończony */
.progress-step.done .step-dot {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.step-label { font-size: .72rem; color: var(--txt-secondary); text-align: center; }
.progress-step.active .step-label { color: var(--brand); font-weight: 600; }

/* Linia */
.step-line {
    flex: 1; height: 2px;
    background: var(--border-light);
    margin-top: -18px;
    transition: var(--ease);
}
.step-line.done { background: var(--brand); }

/* ── Card ────────────────────────────────────────────────── */
.card {
    width: 100%; max-width: 680px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
}
.card-title {
    font-size: 1.5rem; font-weight: 700;
    margin-bottom: .4rem;
    color: var(--txt-primary);
}
.card-desc {
    color: var(--txt-secondary);
    font-size: .9rem; margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

/* ── Form groups ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-weight: 600; font-size: .875rem;
    margin-bottom: .4rem;
    color: var(--txt-primary);
}
.form-group label .required { color: var(--error); margin-left: 2px; }

/* ── Inputs / textarea / select ──────────────────────────── */
input[type="text"],
input[type="date"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem; font-family: inherit;
    background: #fff;
    color: var(--txt-primary);
    transition: border-color var(--ease), box-shadow var(--ease);
    outline: none;
    -webkit-appearance: none; appearance: none;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
    outline: none;
}
input.error, textarea.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(217, 68, 32, 0.12);
}
textarea { resize: vertical; min-height: 100px; }

.field-error {
    display: none;
    color: var(--error);
    font-size: .8rem; margin-top: .3rem;
}
.field-error.visible { display: block; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .75rem 2rem;
    border-radius: 8px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; border: none;
    transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
    text-decoration: none;
    -webkit-appearance: none; appearance: none;
}

/* PRIMARY */
.btn-primary {
    background: var(--brand);
    color: #fff;
    border: none;
}
.btn-primary:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
    color: #fff;
}
.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.btn-primary:active { transform: none; }
.btn-primary:disabled {
    background: var(--border);
    cursor: not-allowed; transform: none;
    color: var(--txt-secondary);
}

.btn-full { width: 100%; justify-content: center; }

/* ── Górny pasek badania: postęp + licznik czasu ─────────── */
.survey-top-bar {
    position: sticky;
    top: 0;
    z-index: 99;
    width: 100%;
    background: #FE5928;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: .75rem 1.5rem;
    box-shadow: 0 2px 12px rgba(254,89,40,.35);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.stb-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.stb-label {
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
}
.stb-bar-track {
    height: 7px;
    background: rgba(255,255,255,.35);
    border-radius: 4px;
    overflow: hidden;
    width: 200px;
}
.stb-bar-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 4px;
    transition: width .35s ease;
}
.stb-timer {
    font-size: 1.15rem;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: -.3px;
}
.stb-timer span { font-size: 1.4rem; }

/* ── Question blocks ─────────────────────────────────────── */
.question-block {
    background: #FFF5F2;
    border-left: 4px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.25rem 1.5rem 1.5rem;
    margin-bottom: 1.5rem;
}
.question-number {
    font-size: .75rem; font-weight: 700;
    color: var(--brand);
    text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: .4rem;
}
.question-text { font-weight: 600; font-size: 1rem; margin-bottom: .8rem; }
.question-text i { font-weight: 400; font-size: .9rem; color: var(--clr-muted); display: block; margin-top: .35rem; }
.question-block textarea { background: #fff; min-height: 90px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: .9rem 1.2rem;
    border-radius: 8px; font-size: .9rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}
.alert-error   { background: #FFF0ED; border-color: var(--error);   color: #7A1A00; }
.alert-success { background: #ECFDF5; border-color: var(--success); color: #065F46; }
.alert-info    { background: #FFF5F2; border-color: var(--brand);   color: #7A1A00; }

/* ── Survey notice ───────────────────────────────────────── */
.survey-notice {
    background: linear-gradient(135deg, #FFF5F2, #FFF0ED);
    border: 1px solid #FFCBB8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-align: center; margin-top: 1.5rem;
    font-size: .9rem; color: #7A1A00;
}
.survey-notice strong { display: block; font-size: 1rem; margin-bottom: .2rem; }

/* ── Finish page ─────────────────────────────────────────── */
.success-icon { font-size: 4rem; text-align: center; margin-bottom: 1rem; }
.success-details { color: var(--txt-secondary); text-align: center; margin-top: .5rem; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .card { padding: 1.5rem; }
    .step-label { display: none; }
    .card-title { font-size: 1.3rem; }
}
@media (max-width: 520px) {
    .survey-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
        padding: .75rem 1rem;
    }
    .stb-bar-track { max-width: 100%; }
    .stb-timer { align-self: flex-end; }
}

/* ══════════════════════════════════════════════════════════════
   OCHRONA IP – reguły druku sa WYLACZNIE w includes/header.php
   (inline, razem z watermarkiem z danymi sesji PHP)
   export.php i strony bledow NIE laduja header.php –
   dlatego reguły druku nie moga byc tutaj, bo blokowaly
   podglad wydruku w export.php (body > * display:none).
   ══════════════════════════════════════════════════════════════ */
