:root {
    --ink: #1c2437;
    --muted: #5b6475;
    --brand: #1f3a5f;
    --accent: #b08d57;
    --bg: #f6f5f2;
    --card: #ffffff;
    --line: #e3e0d8;
    --danger: #a33a3a;
    --radius: 10px;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", Arial, sans-serif;
    line-height: 1.6;
}

a { color: var(--brand); }

/* Top bar */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--card);
    border-block-end: 1px solid var(--line);
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.topbar nav a { text-decoration: none; }
.topbar nav form { margin: 0; }

/* Layout */

main {
    flex: 1;
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
}

h1 { font-size: 1.9rem; line-height: 1.3; margin: 0 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.muted { color: var(--muted); }

.hero {
    padding: 3rem 0 2rem;
    text-align: center;
}

.hero h1 { font-size: 2.4rem; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 40rem; margin: 0 auto 1.5rem; }

.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin-block-start: 1.5rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card p { margin: 0; color: var(--muted); }

.badge {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: #f1e9db;
    color: #7a5d2e;
    font-size: 0.8rem;
}

/* Buttons and forms */

.button,
button,
input[type="submit"] {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary { background: transparent; color: var(--brand); }

button.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
}

.button:hover, button:hover { filter: brightness(1.1); }

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: #fff;
}

input:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

label { display: block; font-weight: 600; margin-block-end: 0.25rem; }

/* allauth pages (sign in, sign up, password reset, ...) */

.auth { max-width: 26rem; margin: 1rem auto; }
.auth form p { margin: 0 0 1rem; }
.auth form p:has(input[type="checkbox"]) label { display: inline; font-weight: normal; }
.auth .helptext, .auth .help-text { display: block; color: var(--muted); font-size: 0.85rem; }
.auth ul { padding-inline-start: 1.2rem; }

.errorlist { color: var(--danger); padding-inline-start: 1.2rem; margin: 0.25rem 0; }

.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.messages li {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: #e8eef6;
    border: 1px solid #c9d6e8;
    margin-block-end: 0.5rem;
}
.messages li.error { background: #f7e4e4; border-color: #e8c3c3; }

@media (max-width: 40rem) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .hero h1 { font-size: 1.9rem; }
}
