:root {
    --bg: #3d3228;
    --bg-deep: #2c241c;
    --sand: #e4c9a0;
    --text: #f7f3eb;
    --muted: rgba(247, 243, 235, 0.78);
    --line: rgba(228, 201, 160, 0.28);
    --card: #f7f1e8;
    --card-text: #2a241c;
    --card-muted: #5c5348;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

html {
    scroll-behavior: smooth;
}

.splash-body {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.splash-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1200px 520px at 50% 118%, rgba(232, 162, 74, 0.42), transparent 60%),
        radial-gradient(900px 460px at 82% -8%, rgba(212, 140, 64, 0.28), transparent 58%),
        radial-gradient(720px 400px at 10% 0%, rgba(196, 154, 98, 0.22), transparent 52%),
        linear-gradient(180deg, #5a4634 0%, #3f3328 46%, #2f261c 100%);
}

.splash-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    top: -3rem;
    z-index: 5;
    padding: 0.5rem 0.85rem;
    background: var(--sand);
    color: #1a160f;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0.75rem;
}

.splash-top,
.splash-main,
.splash-footer {
    position: relative;
    z-index: 1;
}

.splash-top {
    display: flex;
    justify-content: flex-end;
    padding: max(0.9rem, env(safe-area-inset-top)) 1.25rem 0;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.35rem 0.85rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.lang-switch:hover,
.lang-switch:focus-visible {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

.splash-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem 1.5rem;
}

.is-home .splash-main {
    padding-bottom: 0.5rem;
}

.splash-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.splash-logo {
    display: block;
    width: min(72vw, 280px);
    height: auto;
    max-height: 38vh;
    object-fit: contain;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
    animation: rise 0.9s var(--ease) both;
}

[hidden] {
    display: none !important;
}

.splash-wordmark {
    font-size: clamp(2rem, 6vw, 3.25rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
    animation: rise 0.9s var(--ease) both;
}

.splash-footer {
    padding: 1rem 1.25rem max(1.35rem, env(safe-area-inset-bottom));
}

.splash-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.15rem;
}

.splash-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.4rem 1.05rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 999px;
    transition: color 0.2s var(--ease);
}

.splash-links a:not(:last-child)::after {
    content: "";
    position: absolute;
    inset-inline-end: -0.05rem;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--line);
    transform: translateY(-50%);
    pointer-events: none;
}

[dir="rtl"] .splash-links a:not(:last-child)::after {
    inset-inline-end: auto;
    inset-inline-start: -0.05rem;
}

.splash-links a:hover,
.splash-links a:focus-visible {
    color: var(--sand);
    outline: none;
}

.splash-links a[aria-current="page"] {
    color: var(--text);
}

.splash-links a[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.35rem;
    width: 1.15rem;
    height: 2px;
    border-radius: 99px;
    background: var(--sand);
    transform: translateX(-50%);
}

.is-legal .splash-main {
    align-items: flex-start;
    padding: 0.5rem 1.25rem 2rem;
}

.legal-wrap {
    width: min(760px, 100%);
    margin: 0 auto;
    animation: rise 0.7s var(--ease) both;
}

.legal-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.35rem;
}

.legal-logo {
    width: auto;
    height: 48px;
    max-width: 160px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.legal-card {
    background: var(--card);
    color: var(--card-text);
    border-radius: 1.25rem;
    padding: clamp(1.4rem, 3vw, 2.25rem);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 24px 60px -28px rgba(0, 0, 0, 0.55);
}

.legal-title {
    margin: 0 0 1.15rem;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 700;
    line-height: 1.35;
    color: #1c1812;
}

.legal-prose {
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--card-muted);
}

.legal-prose > *:first-child {
    margin-top: 0;
}

.legal-prose > *:last-child {
    margin-bottom: 0;
}

.legal-prose p,
.legal-prose li {
    margin: 0 0 0.85rem;
}

.legal-prose h2,
.legal-prose h3,
.legal-prose h4 {
    color: #1c1812;
    margin: 1.4rem 0 0.55rem;
    line-height: 1.4;
}

.legal-prose ul,
.legal-prose ol {
    padding-inline-start: 1.2rem;
}

.legal-prose a {
    color: #8a4b12;
}

.legal-prose img {
    max-width: 100%;
    height: auto;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delete-subtitle {
    margin: 0 0 1rem;
    color: var(--card-muted);
    line-height: 1.7;
}

.delete-alert {
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    margin-bottom: 1.15rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.delete-alert--success {
    background: #e8f4e9;
    color: #1d5c2a;
}

.delete-alert--error {
    background: #fdeceb;
    color: #8a241c;
}

.delete-alert__list {
    margin: 0;
    padding-inline-start: 1.1rem;
}

.delete-alert__list li + li {
    margin-top: 0.35rem;
}

.delete-form {
    display: grid;
    gap: 1rem;
}

.delete-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.delete-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1c1812;
}

.delete-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.delete-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.4rem 0.95rem;
    border: 1px solid rgba(42, 36, 28, 0.16);
    border-radius: 999px;
    cursor: pointer;
    margin: 0;
    color: var(--card-text);
    background: rgba(255, 255, 255, 0.55);
}

.delete-type:has(input:checked) {
    border-color: #1c1812;
    background: #1c1812;
    color: var(--card);
}

.delete-type input {
    margin: 0;
    accent-color: var(--sand);
}

.delete-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) 1fr;
    gap: 0.75rem;
}

.delete-field {
    display: block;
}

.delete-input {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(42, 36, 28, 0.16);
    border-radius: 0.85rem;
    background: #fff;
    color: var(--card-text);
    font: inherit;
}

.delete-input:focus {
    outline: 2px solid rgba(228, 201, 160, 0.85);
    outline-offset: 1px;
    border-color: #c49a62;
}

.delete-input--select {
    appearance: none;
    cursor: pointer;
    padding-inline-end: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232a241c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
}

[dir="rtl"] .delete-input--select {
    background-position: left 0.8rem center;
}

.delete-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.delete-actions--center {
    justify-content: center;
}

.delete-btn {
    min-height: 48px;
    padding: 0.65rem 1.35rem;
    border: 0;
    border-radius: 999px;
    background: #1c1812;
    color: var(--card);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.delete-btn--danger {
    background: #8b2e1a;
    color: #fff8f4;
}

.delete-btn--ghost {
    background: transparent;
    color: var(--card-text);
    border: 1px solid rgba(42, 36, 28, 0.22);
}

.delete-btn:focus-visible {
    outline: 2px solid #c49a62;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .delete-row {
        grid-template-columns: 1fr;
    }

    .splash-logo {
        width: min(78vw, 220px);
    }

    .splash-links {
        gap: 0;
    }

    .splash-links a {
        padding-inline: 0.8rem;
        font-size: 0.875rem;
    }

    .splash-links a:not(:last-child)::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .splash-logo,
    .splash-wordmark,
    .legal-wrap {
        animation: none;
    }
}
