:root {
    --bg: #f8f5f1;
    --panel: #ffffff;
    --primary: #b85c38;
    --primary-dark: #8a4128;
    --text: #1f2933;
    --muted: #52606d;
    --border: #e5e7eb;
    --shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    width: min(1100px, 90%);
    margin: 0 auto;
}

.site-header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 0.5rem;
    column-gap: 1rem;
    padding: 1rem 0;
}

.brand {
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--primary);
}

.page-content {
    padding: 2rem 0 3rem;
}

h1, h2, h3 {
    color: var(--primary-dark);
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

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

.btn-danger {
    background: #b3261e;
}

.btn-danger:hover {
    background: #8a1d17;
}

/* ---------------------------------------------------------------
   Added to cover the markup in base.html: skip link, flash
   messages, footer and the home page list.
   --------------------------------------------------------------- */

/* Visible only once it's tabbed to — keyboard users can jump the nav. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary-dark);
    color: #fff;
    padding: 0.75rem 1rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Page needs to be a column so the footer sits at the bottom
   even when there is barely any content. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    flex: 1;
}

.nav-user {
    color: var(--muted);
    font-weight: 600;
}

/* Django's messages framework */
.messages {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--muted);
}

.message--success { border-left-color: #2f7d5b; }
.message--error,
.message--danger  { border-left-color: #b3261e; }
.message--warning { border-left-color: #a06400; }
.message--info    { border-left-color: var(--primary); }

.site-footer {
    background: var(--panel);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer p {
    padding: 1.25rem 0;
    margin: 0;
}

.site-footer .licence-line {
    padding-top: 0;
    font-size: 0.82rem;
}

.lead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 60ch;
}

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

.rota-list {
    padding-left: 1.1rem;
    margin: 0 0 1.25rem;
}

.rota-list li {
    margin-bottom: 0.4rem;
}

/* ---- Rota calendar grid (rota_detail.html) ---- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.calendar-day {
    border: 1px solid var(--border);
    border-left: 4px solid var(--muted);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    background: var(--bg);
}

.calendar-day--open {
    border-left-color: var(--primary);
}

.calendar-day--claimed {
    border-left-color: #2f7d5b;
}

.calendar-day__date {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.calendar-day__status {
    font-size: 0.9rem;
    color: var(--muted);
}

.calendar-day__status--claimed {
    color: #2f7d5b;
    font-weight: 600;
}

.calendar-day__notes {
    font-size: 0.85rem;
    color: var(--text);
    margin: 0.4rem 0 0;
    line-height: 1.4;
}

.calendar-day__contact {
    font-size: 0.85rem;
    color: var(--text);
    background: #f8f5f1;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    margin: 0.4rem 0 0;
    line-height: 1.4;
}

.calendar-day .btn-small {
    display: inline-block;
    margin-top: 0.5rem;
}

.calendar-day__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.calendar-day__actions .btn-small {
    margin-top: 0;
}

@media (max-width: 600px) {
    .main-nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* ---- Forms ---- */
.form-card {
    max-width: 30rem;
}

.form-card label {
    display: block;
    font-weight: 600;
    margin-top: 0.75rem;
}

/* form.as_p() wraps every other field in a <p>, which gets its usual
   browser margin — the role radio group is rendered inside a <div>
   instead (a <div> isn't valid inside a <p>), so it needs the same
   margin added by hand to match the spacing of the fields around it. */
.form-card .role-field {
    margin: 1em 0;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-card ul {
    color: var(--muted);
    font-size: 0.88rem;
    padding-left: 1.1rem;
}

.form-card .helptext {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

/* Django wraps per-field errors in <ul class="errorlist"> right above the
   input — give it its own look so it reads as a problem, not more help text. */
.form-card ul.errorlist {
    list-style: none;
    padding: 0.5rem 0.8rem;
    margin: 0.35rem 0 0;
    background: #FBE8E8;
    border-left: 4px solid #B02F2F;
    border-radius: 4px;
    color: #B02F2F;
    font-size: 0.88rem;
    font-weight: 600;
}

.form-card ul.errorlist li {
    margin: 0;
}

/* The invalid input sits in the very next <p> after its errorlist — give
   it a visible red outline too, so the problem field is obvious at a
   glance and not just from the text above it. */
.form-card ul.errorlist + p input,
.form-card ul.errorlist + p select,
.form-card ul.errorlist + p textarea {
    border-color: #B02F2F;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 1px #B02F2F;
}

/* The transparent outline above always shows the red box-shadow, whether
   or not the field is focused — so a keyboard user tabbing onto an
   invalid field needs a stronger, distinct indicator to tell "focused"
   apart from "just invalid". */
.form-card ul.errorlist + p input:focus-visible,
.form-card ul.errorlist + p select:focus-visible,
.form-card ul.errorlist + p textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.form-error {
    background: #FBE8E8;
    border-left: 4px solid #B02F2F;
    padding: 0.7rem 1rem;
    border-radius: 4px;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.92rem;
}

/* A submit button that has to sit inline with nav links */
.logout-form {
    display: inline;
}

.linklike {
    background: none;
    border: 0;
    padding: 0;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.linklike:hover {
    color: var(--primary);
}

/* ---- Homepage: cooking animation next to Rotas running now ---- */
.home-card {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.home-card__body {
    flex: 1;
    min-width: 0;
}

.cook-scene {
    flex: 0 0 150px;
    text-align: center;
}

@media (max-width: 700px) {
    .home-card {
        flex-direction: column;
        align-items: stretch;
    }
    .cook-scene {
        flex-basis: auto;
    }
}

.stove {
    position: relative;
    height: 170px;
}

/* The stovetop the pot sits on — gives the flame something to sit on. */
.hob {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: 120px;
    height: 10px;
    background: #2b2b2b;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.pot {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: 110px;
    height: 66px;
    background: var(--primary-dark);
    border-radius: 10px 10px 20px 20px;
    box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.pot-handle {
    position: absolute;
    top: 15px;
    width: 14px;
    height: 9px;
    border: 4px solid var(--primary-dark);
    border-radius: 4px;
}

.pot-handle--left { left: -14px; }
.pot-handle--right { right: -14px; }

/* Steam rises off the top of the pot. Grey, not white — the card behind
   it is white, so white steam renders but is invisible against it. */
.steam {
    position: absolute;
    bottom: 92px;
    width: 14px;
    height: 14px;
    background: rgba(120, 128, 138, 0.55);
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0;
    z-index: 4;
    animation: rise 3s ease-out infinite;
}

.steam--1 { left: 28px; animation-delay: 0s; }
.steam--2 { left: 50px; animation-delay: 1s; }
.steam--3 { left: 72px; animation-delay: 2s; }

@keyframes rise {
    0%   { opacity: 0;    transform: translate(0, 0) scale(0.7); }
    15%  { opacity: 0.9; }
    100% { opacity: 0;    transform: translate(-8px, -70px) scale(1.6); }
}

.flame {
    position: absolute;
    bottom: 12px;
    font-size: 22px;
    line-height: 1;
    z-index: 3;
    animation: flicker 0.6s ease-in-out infinite alternate;
}

.flame--1 { left: calc(50% - 36px); animation-delay: 0s; transform-origin: bottom center; }
.flame--2 { left: calc(50% - 11px); animation-delay: 0.15s; transform-origin: bottom center; }
.flame--3 { left: calc(50% + 14px); animation-delay: 0.3s; transform-origin: bottom center; }

@keyframes flicker {
    from { transform: scale(1) rotate(-2deg); opacity: 0.85; }
    to   { transform: scale(1.15) rotate(2deg); opacity: 1; }
}

/* Respect anyone who has asked their OS to reduce motion. */
@media (prefers-reduced-motion: reduce) {
    .steam, .flame { animation: none; opacity: 0.6; }
}
