:root {
    --color-bg: #262b33;
    --color-surface: #313640;
    --color-surface-alt: #3a4049;
    --color-text: #f5f5f6;
    --color-muted: #c2c6cf;
    --color-accent: #e0413f;
    --color-accent-hover: #c22e2c;
    --color-border: #4a505b;
    --font-body: 'Source Sans Pro', system-ui, -apple-system, sans-serif;
    --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

h1, h2, h3 { font-weight: 700; margin: 0 0 0.5em; }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Sidebar / menu --- */
.menu-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, transform 0.15s ease;
}
.menu-toggle:hover { background: var(--color-accent-hover); }
.menu-toggle:active { transform: scale(0.94); }

.sidebar {
    position: fixed;
    top: 0; left: -280px;
    width: 260px;
    height: 100%;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    transition: left 0.25s ease;
    z-index: 40;
    padding-top: 5rem;
}
.sidebar.active { left: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
}
.sidebar a:hover { color: var(--color-accent); }

/* --- Hero / sections with background image --- */
.hero, .section-alt {
    background-size: cover;
    background-position: center;
    position: relative;
}
.hero::before, .section-alt::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(20, 22, 26, 0.6);
}
.hero > *, .section-alt > * { position: relative; z-index: 1; }

.hero {
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero-content { max-width: 700px; padding: 2rem; }
.hero-lead { font-size: 1.2rem; color: var(--color-muted); margin-bottom: 2rem; }

.section {
    padding: 4rem 0;
}
.section-alt { padding: 4rem 0; }
.section h2 { text-align: center; font-size: 2rem; }
.section-lead { text-align: center; color: var(--color-muted); margin-bottom: 2rem; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
}
.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; }
.btn-primary { background: var(--color-text); color: var(--color-bg); }
.btn-danger { background: var(--color-accent); color: #fff; }
.btn-danger:hover { background: var(--color-accent-hover); }

/* --- Forms --- */
.card-form, .lookup-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.lookup-form { flex-direction: row; align-items: center; justify-content: center; flex-wrap: wrap; }

.code-input { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; min-width: 0; }
.code-box {
    width: 2.5rem;
    height: 3rem;
    padding: 0;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.95rem; color: var(--color-muted); }
.field-label { display: block; }
.req { color: var(--color-accent); }

input, textarea, select {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 1rem;
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

.details-field {
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
}
.details-field summary { cursor: pointer; color: var(--color-muted); font-weight: 600; }
.details-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.form-result { margin-top: 1rem; }
.lookup-result { margin-top: 1rem; text-align: center; }

.lookup-notice {
    display: block;
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-muted);
    border-radius: var(--radius);
    padding: 0.85rem 1.4rem;
    color: var(--color-text);
    max-width: 640px;
    margin: 0 auto;
    text-align: left;
}
.lookup-notice-error { border-left-color: var(--color-accent); color: #ff8080; }

.ticket-id-box { text-align: center; max-width: 100%; }
.ticket-id-display {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-width: 100%;
}
.id-chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; min-width: 0; }
.id-chip {
    width: 2.75rem;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
}
.btn-copy { padding: 0.5rem 1.1rem; font-size: 0.9rem; }
.form-errors { color: #ff8080; padding-left: 1.2rem; }
.form-success { color: #6fdc8c; }
.form-error { color: #ff8080; }

/* --- Ticket card (public lookup) --- */
.ticket-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 640px;
    margin: 1.5rem auto 0;
    text-align: left;
}
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    vertical-align: middle;
}
.status-otevrena { background: #4b3a12; color: #ffcf70; }
.status-v_reseni { background: #123a4b; color: #7fd0ff; }
.status-vyresena { background: #16401e; color: #7fe08b; }

.ticket-thread { display: flex; flex-direction: column; gap: 0.85rem; margin: 1rem 0; }
.thread-message {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: var(--color-surface-alt);
}
.thread-reporter { border-left: 3px solid var(--color-accent); }
.thread-admin { border-left: 3px solid #4f9dff; }
.thread-system { border-left: 3px solid var(--color-muted); font-style: italic; opacity: 0.85; }
.thread-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-bottom: 0.35rem;
}
.reply-form { display: flex; flex-direction: column; gap: 0.75rem; }

/* --- Footer --- */
.footer {
    padding: 2rem 0;
    text-align: center;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}
.footer p { margin: 0.3rem 0; }
.footer a { color: var(--color-accent); text-decoration: none; }
.muted { color: var(--color-muted); font-size: 0.9rem; }

@media (max-width: 600px) {
    .lookup-form { flex-direction: column; }
}

@media (max-width: 420px) {
    .card-form, .lookup-form { padding: 1.25rem; }
    .id-chip { width: 2.15rem; height: 2.6rem; font-size: 1.15rem; }
    .code-box { width: 2.15rem; height: 2.6rem; font-size: 1.15rem; }
    .ticket-id-display { padding: 0.85rem 1rem; gap: 0.6rem; }
}
