:root {
    color-scheme: dark;
    --bg: #090d18;
    --surface: rgba(18, 25, 42, 0.88);
    --surface-raised: #18223a;
    --border: rgba(148, 163, 184, 0.18);
    --text: #f4f7fb;
    --muted: #9aa8bf;
    --accent: #8b5cf6;
    --accent-bright: #a78bfa;
    --accent-soft: rgba(139, 92, 246, 0.16);
    --danger: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0 1.25rem 4rem;
    color: var(--text);
    background:
        radial-gradient(circle at 85% 0%, rgba(124, 58, 237, 0.2), transparent 30rem),
        radial-gradient(circle at 0% 55%, rgba(14, 165, 233, 0.1), transparent 28rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

header,
main {
    width: min(100%, 920px);
    margin: 0 auto;
}

header {
    padding: 1.5rem 0;
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(16px);
}

nav a {
    padding: 0.55rem 0.9rem;
    border-radius: 0.7rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

nav a:hover,
nav a:focus-visible {
    color: var(--text);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

main {
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

h1,
h2 {
    margin: 0 0 1rem;
    color: var(--text);
    letter-spacing: -0.035em;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
}

h2 {
    font-size: clamp(1.35rem, 3vw, 2rem);
}

p {
    color: var(--muted);
}

a {
    color: var(--accent-bright);
    font-weight: 600;
}

a:hover,
a:focus-visible {
    color: #c4b5fd;
}

form {
    display: grid;
    gap: 0.65rem;
    max-width: 38rem;
    margin: 1.75rem 0;
}

label {
    display: block;
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    outline: none;
    padding: 0.8rem 0.9rem;
    color: var(--text);
    background: rgba(8, 13, 27, 0.72);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus {
    border-color: var(--accent-bright);
    background: rgba(8, 13, 27, 0.95);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="checkbox"] {
    width: auto;
    margin: 0 0.45rem 0 0;
    accent-color: var(--accent);
    vertical-align: middle;
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

button {
    width: fit-content;
    margin-top: 0.6rem;
    border: 0;
    border-radius: 0.75rem;
    padding: 0.75rem 1.15rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.28);
    cursor: pointer;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

button:hover,
button:focus-visible {
    filter: brightness(1.12);
    box-shadow: 0 10px 26px rgba(109, 40, 217, 0.42);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

img {
    display: block;
    max-width: 100%;
    border-radius: 1rem;
}

article {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

#picture {
    width: min(100%, 760px);
    margin: 1rem 0;
    border: 1px solid var(--border);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

#date-shown {
    color: var(--accent-bright);
    font-size: 0.9rem;
    font-weight: 700;
}

#guestbook-list {
    display: grid;
    gap: 0.85rem;
    padding: 0;
    list-style: none;
}

#guestbook-list li {
    margin: 0;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: rgba(30, 41, 59, 0.55);
}

#form-error,
#list-error,
#register-message,
#status,
#auth-error {
    color: var(--danger);
    font-weight: 600;
}

#status:empty,
#auth-error:empty,
#form-error:empty,
#list-error:empty,
#register-message:empty {
    display: none;
}

@media (max-width: 600px) {
    body {
        padding: 0 0.75rem 2rem;
    }

    header {
        padding: 0.75rem 0;
    }

    nav {
        gap: 0.15rem;
    }

    nav a {
        padding: 0.5rem 0.65rem;
        font-size: 0.82rem;
    }

    main {
        padding: 1.35rem;
        border-radius: 1.15rem;
    }
}
