/*
Styles for the pages that live outside the admin theme: the landing page
(templates/home.html) and the password set/reset flow
(templates/registration/). The admin itself is styled by
static/admin/css/dfa_jazzmin.css; the brand tokens below are the same.
https://styleguide.dataforall.org/v5/about.html
*/

:root {
    --dfa-primary: #983365;
    --dfa-primary-dark: #6B1B43;
    --dfa-accent: #EF9F38;
    --dfa-accent-hover: #d98a24;
    --dfa-accent-ink: #3a2308;
    --dfa-ink: #2b2b2b;
    --dfa-muted: #555;
    --dfa-error: #b3261e;
    --dfa-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    margin: 0;
    font-family: var(--dfa-font);
    color: var(--dfa-ink);
    -webkit-text-size-adjust: 100%;
}

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

/* The one filled call-to-action style, shared by both page families. */
.dfa-btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: 6px;
    background: var(--dfa-accent);
    color: var(--dfa-accent-ink);
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.dfa-btn:hover,
.dfa-btn:focus-visible {
    background: var(--dfa-accent-hover);
}
.dfa-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* =====================================================================
   Landing page (templates/home.html)
   ===================================================================== */
.home {
    background: #faf8f9;
}
.home-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    background: var(--dfa-primary-dark);
}
.home-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}
.home-brand img {
    height: 32px;
    width: auto;
}
.home-login {
    padding: 0.55rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.home-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.home-logout {
    margin: 0;
}
.home-login--ghost {
    background: transparent;
    color: #fff;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.home-login--ghost:hover,
.home-login--ghost:focus-visible {
    background: rgba(255, 255, 255, 0.15);
}
.home-hero {
    padding: 5rem 1.5rem 6rem;
    background: linear-gradient(135deg, var(--dfa-primary-dark), var(--dfa-primary));
    color: #fff;
    text-align: center;
}
.home-hero h1 {
    margin: 0 0 0.75rem;
    /* Scales between the phone and desktop sizes instead of jumping at a
       single breakpoint. */
    font-size: clamp(2rem, 1.5rem + 2.5vw, 2.6rem);
    font-weight: 700;
}
.home-hero p {
    max-width: 620px;
    margin: 0 auto 2rem;
    font-size: clamp(1rem, 0.95rem + 0.4vw, 1.15rem);
    color: rgba(255, 255, 255, 0.9);
}
.home-cta {
    padding: 0.85rem 2.2rem;
    border-radius: 8px;
    font-size: 1.05rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.home-cta:hover {
    transform: translateY(-2px);
}
.home-main {
    max-width: 1080px;
    margin: -3rem auto 0;
    padding: 0 1.5rem 4rem;
}
.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.home-feature {
    padding: 1.75rem 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}
.home-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--dfa-primary);
    color: #fff;
    font-size: 1.4rem;
}
.home-feature h2 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--dfa-primary-dark);
}
.home-feature p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--dfa-muted);
}
.home-footer {
    padding: 1.5rem;
    color: #888;
    font-size: 0.85rem;
    text-align: center;
}

/* Phone/small-tablet: the layout already reflows (the features grid is
   auto-fit); this only trims the desktop gutters and padding, which at
   360px ate a sixth of the width. */
@media (max-width: 640px) {
    .home-header {
        padding: 1rem 1.15rem;
    }
    .home-brand {
        gap: 0.5rem;
        font-size: 1.1rem;
    }
    .home-brand img {
        height: 26px;
    }
    .home-login {
        padding: 0.5rem 1.1rem;
        font-size: 0.9rem;
    }
    .home-hero {
        padding: 3.25rem 1.15rem 4.5rem;
    }
    .home-hero p {
        margin-bottom: 1.5rem;
    }
    .home-cta {
        padding: 0.75rem 1.75rem;
        font-size: 1rem;
    }
    .home-main {
        padding: 0 1.15rem 3rem;
    }
    .home-features {
        gap: 1rem;
    }
    .home-feature {
        padding: 1.4rem 1.15rem;
    }
}

/* =====================================================================
   Password set/reset pages (templates/registration/_auth_base.html)
   ===================================================================== */
.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    /* Without a gutter the card ran edge to edge on a phone. */
    padding: 1rem;
    background: linear-gradient(135deg, var(--dfa-primary-dark), var(--dfa-primary));
}
.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 2.5rem;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.auth-card.is-centered {
    text-align: center;
}
.auth-card h1 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    color: var(--dfa-primary-dark);
}
.auth-card p {
    line-height: 1.5;
    color: #444;
}
.auth-card .help {
    margin: -0.5rem 0 1.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--dfa-muted);
}
.auth-field + .auth-field {
    margin-top: 1rem;
}
.auth-card label {
    display: block;
    margin: 0 0 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    /* 16px keeps iOS Safari from zooming the page in on focus. */
    font-size: 1rem;
}
.auth-card input:focus {
    border-color: var(--dfa-primary);
    outline: 2px solid rgba(152, 51, 101, 0.25);
    outline-offset: 0;
}
.auth-submit {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.7rem;
    font-size: 1rem;
}
.auth-link {
    margin-top: 1.25rem;
}
.auth-back {
    margin: 1.25rem 0 0;
    font-size: 0.85rem;
    text-align: center;
}
.auth-back a {
    color: var(--dfa-primary);
    text-decoration: none;
}
.auth-back a:hover {
    text-decoration: underline;
}
.errorlist {
    margin: 0.3rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--dfa-error);
}

/* Show/hide toggle overlaid on the right of a password input. */
.dfa-password-wrap {
    position: relative;
}
.dfa-password-wrap input {
    padding-right: 2.25rem !important;
}
.dfa-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    padding: 0.25rem;
    border: none;
    background: none;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
}
.dfa-password-toggle:hover,
.dfa-password-toggle:focus-visible {
    color: var(--dfa-primary);
}
.dfa-password-toggle svg {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
}

@media (max-width: 400px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
    }
}
