:root {
    --primary: #e8891c;
    --primary-dark: #c46f0f;
    --bg: #fdf6ec;
    --card: #ffffff;
    --text: #2b2118;
    --muted: #8a7a6a;
    --border: #eadcc8;
    --success: #2e8b57;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

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

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logo {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.tagline {
    margin: 0.25rem 0 0;
    opacity: 0.9;
}

/* Layout */
.container {
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h2 {
    font-size: 1.2rem;
    margin: 0 0 1rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Form */
.composer {
    margin-bottom: 2rem;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

input,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 137, 28, 0.2);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-count {
    color: var(--muted);
    font-size: 0.85rem;
}

.char-count.warn {
    color: #c0392b;
}

button,
.button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.5rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

button:active,
.button:active {
    transform: scale(0.97);
}

.button {
    display: inline-block;
    text-decoration: none;
}

button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.feedback {
    margin: 0.75rem 0 0;
    min-height: 1.5em;
    color: var(--success);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.feedback.visible {
    opacity: 1;
}

/* Message list */
.roar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.roar-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.author {
    font-weight: 700;
}

.time {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.85rem;
}

.roar-text {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* New messages slide in */
.roar.new {
    animation: slide-in 0.4s ease-out;
    border-color: var(--primary);
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header navigation */
.logo a {
    color: inherit;
    text-decoration: none;
}

.site-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.site-nav a {
    color: white;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid white;
    border-radius: 999px;
    padding: 0.3rem 1rem;
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Login and register */
.auth h1 {
    font-size: 1.4rem;
    margin: 0 0 1rem;
}

.field-error {
    margin: -0.75rem 0 0.75rem;
    color: #c0392b;
    font-size: 0.85rem;
}

.field-error:empty {
    display: none;
}

input[aria-invalid="true"] {
    border-color: #c0392b;
}

.auth-switch {
    margin: 0.5rem 0 0;
}

.auth-switch a {
    color: var(--primary-dark);
    font-weight: 600;
}

/* 404 page */
.not-found {
    text-align: center;
    padding: 2.5rem 1.25rem;
}

.not-found h1 {
    font-size: 1.4rem;
    margin: 0 0 0.5rem;
}

.not-found-code {
    margin: 0;
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary);
}

.not-found-text {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

/* Footer */
.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 2rem 1rem;
}
