:root {
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --border-soft: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: #dbeafe;
    --radius-lg: 14px;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #e5e7eb 0, #f9fafb 45%, #f3f4f6 100%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
    margin-bottom: 28px; /* větší mezera od formuláře */
}

.topbar h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
}

.topbar a {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.topbar a:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

form {
    width: 100%;
    max-width: 1000px;
    background: var(--bg-card);
    border-radius: 24px;
    padding: 24px 24px 28px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(6px);
    margin: 0 auto;
}

h2 {
    margin: 24px 0 10px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    display:block;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.row {
    display:flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.row > div {
    flex:1;
    min-width: 220px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: #f9fafb;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}


input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

button[type="submit"] {
    margin-top: 18px;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button[type="submit"]:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.30);
}

button[type="submit"]::after {
    content: "⟶";
    font-size: 0.9em;
}

/* Language switch (radio CZ / EN) */
.language-switch {
    display: inline-flex;
    border-radius: 999px;
    padding: 2px;
    background: #f3f4f6;
    border: 1px solid var(--border-soft);
    margin-top: 6px;
}

.language-switch input {
    display: none;
}

.language-switch.small label {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.language-switch.small {
    transform: scale(0.9);
}


.language-switch label {
    padding: 6px 14px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: 0.18s;
    user-select: none;
    color: var(--text-muted);
    border-radius: 999px;
}

.language-switch input:checked + label {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.35);
}

.language-switch label:hover {
    background: #e5e7eb;
}

/* Messages */
.message {
    max-width: 840px;
    margin: 0 auto 12px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.message.success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.profile-actions .logout-btn {
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    text-decoration: none;
    background: #f3f4f6;
    transition: 0.15s;
}

.profile-actions .logout-btn:hover {
    background: #e5e7eb;
}

.profile-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

/* DŮLEŽITÉ: zrušíme margin-top u tlačítka uvnitř řádku */
.profile-actions button[type="submit"] {
    margin-top: 0;
}

.profile-actions .logout-btn {
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    text-decoration: none;
    background: #f3f4f6;
    transition: 0.15s;
    display: inline-flex;
    align-items: center;
}


/* RESPONSIVE */
@media (max-width: 900px) {
    body {
        padding: 16px;
        display: block;           /* ať se to neroztahuje flexem přes šířku */
    }

    form {
        padding: 18px 16px 22px;
        border-radius: 18px;
        max-width: 100%;          /* karta přes celou šířku */
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .topbar h1 {
        font-size: 1.15rem;
    }

    .row {
        flex-direction: column;
        gap: 10px;
    }

    .row > div {
        min-width: 100%;
    }

    @media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        border-radius: 14px;
    }

    .app-header-left,
    .app-header-right {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .language-switch.small {
        transform: scale(1);
    }
    }

}

/* ==== LAYOUT SHELL ==== */
..app-shell {
    width: 100%;
    max-width: 1100px;  /* stejná šířka jako header */
    padding: 0 20px;    /* malé okraje vlevo/vpravo */
    margin: 0 auto;
}


.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 14px 22px;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}


.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9rem;
}

.app-logo-text {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.app-lang-form {
    margin: 0;
}

.app-main {
    /* nic speciálního, jen drží obsah */
}

.app-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ==== LOGIN CARD ==== */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 22px 20px 24px;
    margin: 0 auto;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(6px);
}

.auth-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.auth-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.auth-error {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.85rem;
}

/* responzivita - můžeme zůstat u tvého @media (max-width: 900px) */
.app-header-left {
    display: flex;
    align-items: center;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo-mark {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.85rem;
}

.app-logo-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}
