/* MyClub — mobile-first stylesheet. */

:root {
    --brand: #1f7a3d;
    --brand-dark: #155c2c;
    --bg: #f5f6f5;
    --surface: #ffffff;
    --text: #1f2421;
    --muted: #5d6b62;
    --border: #d9e0db;
    --danger: #c0392b;
    --radius: 10px;
    --maxw: 900px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; }
h1:focus { outline: none; }

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

/* Hlavička */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--brand);
    color: #fff;
    padding: 0.7rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-nav a { color: #fff; text-decoration: none; }
.auth-nav a:hover { text-decoration: underline; }
.auth-nav .user { font-size: 0.9rem; opacity: 0.9; }
.auth-nav form { margin: 0; }

/* Obsah */
main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* Formuláře */
.auth-form {
    max-width: 420px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

form label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-weight: 600;
    font-size: 0.95rem;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 122, 61, 0.15);
}

label > input[type="checkbox"] { width: auto; display: inline-block; margin-right: 0.4rem; }

button, .btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

button:hover { background: var(--brand-dark); }
button.danger { background: var(--danger); }
button.link {
    background: none;
    color: #fff;
    padding: 0;
    margin: 0;
    font-weight: 600;
    text-decoration: underline;
}
button.link:hover { background: none; }

/* Tabulky */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #eef3ef;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.data-table tr:last-child td { border-bottom: none; }

/* Externí login (OAuth) */
.external-login { margin-top: 1.25rem; }
.external-login .sep {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.5rem 0;
}
.external-login form { display: flex; flex-direction: column; gap: 0.5rem; }
button.ext {
    margin-top: 0;
    color: #fff;
    width: 100%;
    text-align: center;
}
button.ext-google { background: #4285f4; }
button.ext-google:hover { background: #3367d6; }
button.ext-facebook { background: #1877f2; }
button.ext-facebook:hover { background: #145dbf; }

/* Admin nav */
.admin-nav ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-nav a {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
}

/* Validace / chyby */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 0.9rem; }
.error { color: var(--danger); }
ul.error { padding-left: 1.2rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
    border-radius: 8px;
}
.blazor-error-boundary::after { content: "Došlo k chybě."; }

/* Blazor unhandled-error UI — skryté, dokud Blazor nenastaví display:block */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (min-width: 640px) {
    h1 { font-size: 1.9rem; }
}
