/* ============================================================
   style.css – sdílené styly pro GDPR portál
   (index.php · souhlas.php · admin.php)
   ============================================================ */

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

/* ── CSS proměnné (veřejný portál) ── */
:root {
    --clr-bg: #0f1117;
    --clr-surface: #1a1d27;
    --clr-surface2: #222639;
    --clr-border: #2e3250;
    --clr-accent: #6366f1;
    --clr-accent-h: #818cf8;
    --clr-success: #22c55e;
    --clr-error: #ef4444;
    --clr-warn: #f59e0b;
    --clr-text: #e2e8f0;
    --clr-muted: #94a3b8;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, .45);
}

.zluty-text {
    color: var(--clr-warn) !important;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    background: var(--clr-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99, 102, 241, .18) 0%, transparent 70%);
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--clr-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 48px;
}

body.body--souhlas {
    justify-content: flex-start;
}

/* ── Hlavička ── */
.header {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeUp .5s ease both;
}

.header--souhlas {
    margin-bottom: 28px;
}

.school-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.school-logo {
    max-height: 60px;
    width: auto;
    display: block;
}

.school-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--clr-muted);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.header .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, .15);
    border: 1px solid rgba(99, 102, 241, .35);
    color: var(--clr-accent-h);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.header--souhlas .badge {
    margin-bottom: 14px;
}

.header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #e2e8f0 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header--souhlas h1 {
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
}

.header p {
    color: var(--clr-muted);
    font-size: .95rem;
    margin-top: 10px;
    max-width: 480px;
}

/* ── Karta ── */
.card {
    width: 100%;
    max-width: 520px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 40px;
    animation: fadeUp .55s .05s ease both;
}

.card--souhlas {
    max-width: 680px;
}

/* ── Stepper ── */
.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--clr-border);
    z-index: 0;
}

.step:last-child::after {
    display: none;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--clr-surface2);
    border: 2px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: all .3s;
}

.step.active .step-dot {
    background: var(--clr-accent);
    border-color: var(--clr-accent);
    color: #fff;
}

.step.done .step-dot {
    background: var(--clr-success);
    border-color: var(--clr-success);
    color: #fff;
}

.step-label {
    font-size: .7rem;
    color: var(--clr-muted);
    font-weight: 500;
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--clr-accent-h);
}

.step.done .step-label {
    color: var(--clr-success);
}

/* ── Formulář ── */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--clr-muted);
    margin-bottom: 8px;
    letter-spacing: .03em;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    color: var(--clr-text);
    font-size: .95rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

input[readonly] {
    opacity: .7;
    cursor: not-allowed;
}

.input-hint {
    font-size: .78rem;
    color: var(--clr-muted);
    margin-top: 5px;
}

/* ── Info box žáka (index.php) ── */
.info-zak {
    background: rgba(99, 102, 241, .08);
    border: 1px solid rgba(99, 102, 241, .25);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-zak-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-zak-text {
    font-size: .9rem;
    color: var(--clr-muted);
}

.info-zak-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--clr-text);
}

/* ── Info žáka (souhlas.php – jiný design) ── */
.info-zak--souhlas {
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    gap: 14px;
    /* přepsat barvy z výchozí varianty */
    background: var(--clr-surface2);
    border-color: var(--clr-border);
}

.info-zak--souhlas .info-zak-icon {
    font-size: 2rem;
}

.info-zak-label {
    font-size: .78rem;
    color: var(--clr-muted);
    font-weight: 500;
}

.info-zak-stav {
    margin-top: 4px;
    font-size: .85rem;
}

/* ── Stavy souhlasu ── */
.stav-ceka {
    color: var(--clr-warn);
}

.stav-udelen {
    color: var(--clr-success);
}

.stav-odmitnut {
    color: var(--clr-error);
}

/* ── Scrollovatelný GDPR text ── */
.gdpr-text {
    background: var(--clr-surface2);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 24px;
    max-height: 450px;
    overflow-y: auto;
    font-size: .88rem;
    line-height: 1.7;
    color: var(--clr-muted);
    white-space: pre-wrap;
}

.gdpr-text::-webkit-scrollbar {
    width: 6px;
}

.gdpr-text::-webkit-scrollbar-track {
    background: transparent;
}

.gdpr-text::-webkit-scrollbar-thumb {
    background: var(--clr-border);
    border-radius: 3px;
}

/* ── Upozornění ── */
.alert {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: .88rem;
    font-weight: 500;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-error {
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, .1);
    border: 1px solid rgba(34, 197, 94, .3);
    color: #86efac;
}

.alert-warn {
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .3);
    color: #fcd34d;
}

.alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Tlačítka – společné ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .02em;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-accent) 0%, #818cf8 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, .35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, .5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--clr-muted);
    border: 1px solid var(--clr-border);
    margin-top: 10px;
    font-size: .85rem;
}

.btn-ghost:hover {
    background: var(--clr-surface2);
    color: var(--clr-text);
}

/* Skupina tlačítek (souhlas.php) */
.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 140px;
    width: auto;
    padding: 13px 20px;
    font-size: .93rem;
    font-weight: 700;
}

.btn-yes {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(34, 197, 94, .3);
}

.btn-yes:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, .45);
}

.btn-no {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, .3);
}

.btn-no:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, .45);
}

.btn:active {
    transform: translateY(0);
}

/* ── Stav „odesláno" (index.php) ── */
.success-state {
    text-align: center;
    padding: 10px 0;
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: pop .5s .1s cubic-bezier(.34, 1.56, .64, 1) both;
}

.success-state h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.success-state p {
    color: var(--clr-muted);
    font-size: .9rem;
    line-height: 1.6;
}

.success-email {
    display: inline-block;
    background: rgba(99, 102, 241, .12);
    border: 1px solid rgba(99, 102, 241, .28);
    color: var(--clr-accent-h);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 6px;
    margin: 0 2px;
    word-break: break-all;
}

/* ── Stav „neplatný token / pozastaveno" (souhlas.php) ── */
.state-box {
    text-align: center;
    padding: 20px 0 10px;
}

.state-box .icon {
    font-size: 3rem;
    margin-bottom: 14px;
}

.state-box h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.state-box p {
    color: var(--clr-muted);
    font-size: .9rem;
    line-height: 1.6;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    color: var(--clr-accent-h);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    transition: color .2s;
}

.back-link:hover {
    color: #c7d2fe;
}

/* ── Section title ── */
.section-title {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--clr-muted);
    margin-bottom: 12px;
}

/* ── Patička ── */
.footer {
    margin-top: 24px;
    font-size: .75rem;
    color: var(--clr-muted);
    text-align: center;
    opacity: .7;
    animation: fadeUp .6s .1s ease both;
}

/* ── Animace ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Responzivita ── */
@media (max-width: 560px) {
    .card {
        padding: 28px 22px;
    }

    .card--souhlas {
        padding: 24px 18px;
    }

    .btn-group {
        flex-direction: column;
    }
}

/* ============================================================
   admin.php – přihlašovací obrazovka
   ============================================================ */
body.body--admin-login {
    background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 123, 255, .15) 0%, transparent 70%);
    justify-content: center;
}

body.body--admin-login input[type="text"]:focus,
body.body--admin-login input[type="password"]:focus {
    border-color: #007bff;
    box-shadow: none;
}

body.body--admin-login .card {
    max-width: 400px;
    animation: none;
}

.admin-login-header {
    text-align: center;
    margin-bottom: 24px;
}

.admin-login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.admin-login-header p {
    font-size: 0.88rem;
    color: var(--clr-muted);
    margin-top: 6px;
}

.btn-admin-login {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s;
}

.btn-admin-login:hover {
    background: #0056b3;
}

.alert-admin-login {
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #fca5a5;
    border-radius: 8px;
    padding: 12px;
    font-size: .88rem;
    margin-bottom: 20px;
    text-align: center;
}

/* ============================================================
   admin.php – administrační panel (světlý layout)
   ============================================================ */
body.body--admin-panel {
    background: #e9ecef;
    background-image: none;
    color: #333;
    display: block;
    padding: 20px;
    font-family: Arial, sans-serif;
    min-height: unset;
}

.admin-container {
    max-width: 1400px;
    margin: auto;
}

.admin-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.body--admin-panel .admin-card textarea {
    width: 100%;
    height: 300px !important;
    min-height: 300px !important;
    padding: 12px;
    margin: 10px 0;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.admin-table th {
    background: #007bff;
    color: white;
}

.admin-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.badge-admin {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
    display: inline-block;
}

.badge-ceka {
    background: #ffc107;
    color: #212529;
}

.badge-udelen {
    background: #28a745;
}

.badge-odmitnut {
    background: #dc3545;
}

.btn-admin {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95em;
}

.btn-admin:hover {
    background: #0056b3;
}

.btn-admin--danger {
    background: #dc3545;
    text-decoration: none;
    padding: 8px 16px;
    font-size: 0.9em;
    display: inline-block;
}

.btn-admin--danger:hover {
    background: #b91c1c;
}

.alert-info-admin {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #bee5eb;
    font-weight: bold;
}

code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, monospace;
}

.search-wrap {
    margin-bottom: 14px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.97em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .2);
}

th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    background: #0069d9;
}

th.sortable .sort-icon {
    display: inline-block;
    margin-left: 6px;
    opacity: .55;
    font-style: normal;
    font-size: .8em;
}

th.sortable.asc .sort-icon::after {
    content: '▲';
    opacity: 1;
}

th.sortable.desc .sort-icon::after {
    content: '▼';
    opacity: 1;
}

th.sortable:not(.asc):not(.desc) .sort-icon::after {
    content: '⇅';
}

tr.hidden-row {
    display: none;
}

.no-results {
    text-align: center;
    color: #777;
    padding: 16px;
    display: none;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.pagination button:hover:not(:disabled) {
    background: #e9ecef;
}

.pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.pagination button:disabled {
    opacity: .4;
    cursor: default;
}

.pagination-info {
    font-size: 0.88em;
    color: #666;
    margin-left: auto;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ccc;
    padding-bottom: 15px;
    margin-top: 10px;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 1.8rem;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-topbar-user {
    color: #555;
    font-size: 0.95em;
}