:root {
    --primary: #8c1519;
    --primary-dark: #6d0f12;
    --accent: #f0c07a;
    --ink: #1f1b1c;
    --muted: #6e5f62;
    --surface: #ffffff;
    --surface-muted: #f6f0ee;
    --border: #e7d9d6;
    --shadow: 0 20px 60px rgba(43, 26, 26, 0.18);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Sora', 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--surface-muted);
    min-height: 100vh;
}

.background {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(140, 21, 25, 0.15), transparent 55%),
        radial-gradient(circle at 20% 20%, rgba(240, 192, 122, 0.35), transparent 45%),
        linear-gradient(120deg, #f9f3f1, #f0e6e2 60%, #efe2dd);
    z-index: -1;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 6vw 12px;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 6px;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
}

.nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background: rgba(140, 21, 25, 0.12);
    color: var(--primary-dark);
}

.content {
    padding: 20px 6vw 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.grid {
    display: grid;
    gap: 24px;
}

.two-col {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.three-col {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(231, 217, 214, 0.7);
}

.card.wide {
    padding: 32px;
}

.hero {
    background: linear-gradient(130deg, rgba(140, 21, 25, 0.08), rgba(240, 192, 122, 0.25));
}

.form-card h2,
.card h1,
.card h2 {
    margin-top: 0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-form {
    margin-top: 16px;
    gap: 12px;
    align-items: flex-end;
}

.filter-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inline-form.align-right {
    margin-left: auto;
    align-items: flex-end;
}

.inline-form select,
.inline-form .btn {
    min-height: 48px;
}

.absences-list {
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.checkbox-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 10px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    margin: 0;
    justify-self: end;
}

.simple-list {
    margin: 12px 0 0;
    padding-left: 18px;
}

.steps-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 12px;
}

.carousel {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    position: relative;
}

.carousel-panel {
    grid-area: 1 / 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.carousel-panel.is-active,
.carousel-panel.is-exit-left,
.carousel-panel.is-enter-right {
    display: block;
}

.carousel-panel.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.carousel-panel.is-exit-left {
    opacity: 0;
    transform: translateX(-100%);
}

.carousel-panel.is-enter-right {
    opacity: 0;
    transform: translateX(100%);
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(43, 26, 26, 0.08);
}

.step-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 8px;
}

.hidden {
    display: none;
}

.slide-out-left {
    animation: slideOutLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-24px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    color: var(--muted);
}

input {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: inherit;
}

select {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}

input:focus {
    outline: 2px solid rgba(140, 21, 25, 0.25);
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 12px 22px;
    border: none;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 24px rgba(140, 21, 25, 0.25);
}

.btn.primary:hover {
    transform: translateY(-1px);
}

.btn.ghost {
    background: rgba(140, 21, 25, 0.08);
    color: var(--primary-dark);
}


.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-weight: 600;
}

.alert.error {
    background: rgba(140, 21, 25, 0.1);
    color: var(--primary-dark);
}

.alert.success {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

.alert.success.spaced {
    margin-top: 14px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 12px;
}

.feature-list li {
    padding-left: 22px;
    position: relative;
    color: var(--muted);
}

.feature-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.4rem;
    line-height: 0.8;
}

.spacer {
    height: 12px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(140, 21, 25, 0.1);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-title {
    color: var(--muted);
    font-weight: 600;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.metric-sub {
    color: var(--muted);
}

.headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.actions.align-right {
    justify-content: flex-end;
}

.next-actions {
    margin-top: 24px;
}

.btn.primary#absence-next {
    padding: 14px 28px;
    font-size: 1rem;
}

.api-table {
    width: 100%;
    border-collapse: collapse;
}

.api-table th,
.api-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.method {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 6px;
}

.method-get {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

.method-post {
    background: rgba(21, 101, 192, 0.12);
    color: #1565c0;
}

.method-patch,
.method-put {
    background: rgba(251, 140, 0, 0.15);
    color: #ef6c00;
}

.method-delete {
    background: rgba(198, 40, 40, 0.15);
    color: #c62828;
}

.secret-code {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.code-inline {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: var(--muted);
}

.code-block {
    background: #1f1b1c;
    color: #f6f0ee;
    padding: 16px;
    border-radius: 12px;
    overflow: auto;
    font-size: 0.85rem;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    align-items: center;
}

.qr img {
    width: 180px;
    height: 180px;
    border-radius: 18px;
    background: #fff;
    padding: 12px;
    box-shadow: var(--shadow);
}

.site-footer {
    padding: 12px 6vw 30px;
    color: var(--muted);
    font-size: 0.85rem;
}

@media (max-width: 720px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .actions .btn {
        width: 100%;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .inline-form .btn {
        width: 100%;
    }
}
