/*
 * Auth pages (layouts/auth.php): login, registration, password reset, email
 * verification, two-factor, OAuth linking, and game/create-character. Loaded
 * after css/home.css, which already styles the header, footer, buttons and the
 * shared form controls (.form-group, .form-control, .checkbox-label, .btn-oauth...).
 */

/*
 * The views keep their own <style> blocks, written against the game's app.css
 * variables. Same names here, in the site's palette, so those blocks follow
 * without being rewritten.
 */
:root {
    --color-primary: #B91C25;
    --color-primary-dark: #8C1018;
    --color-primary-light: #E4C99D;
    --color-primary-glow: rgba(185, 28, 37, 0.35);
    --color-success: #5FB86A;
    --color-danger: #E0434B;
    --color-warning: #D9A441;
    --color-border: #343A42;
    --color-border-light: #4A515A;
    --color-bg-light: #161A20;
    --color-bg-lighter: #1C2128;
    --color-bg-card: #12161B;
    --color-text: #E9E4DC;
    --color-text-muted: #9EA4AD;
}

/* ---------- Page and card ---------- */

.auth-main {
    padding: clamp(28px, 5vw, 56px) var(--gutter) clamp(40px, 6vw, 72px);
    background:
        radial-gradient(ellipse 70% 360px at 50% 0, rgba(140, 16, 24, 0.18), transparent 70%),
        var(--dtg-bg);
}

.auth-shell {
    width: min(460px, 100%);
    margin-inline: auto;
}

/* The registration and character wizards pick a race and class from a grid: give them room. */
.auth-shell:has(.wizard-progress) {
    width: min(820px, 100%);
}

.auth-card {
    position: relative;
    padding: clamp(22px, 4vw, 34px);
    background: linear-gradient(180deg, #171B21 0%, #0E1115 100%);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(228, 201, 157, 0.08);
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 12px;
    height: 12px;
    border-top: 1px solid var(--dtg-gold);
    border-left: 1px solid var(--dtg-gold);
    opacity: 0.7;
    pointer-events: none;
}

.auth-title {
    margin: 0 0 22px;
    color: var(--dtg-gold-pale);
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}

/* home.css zeroes these for its own sections; the auth texts expect normal spacing. */
.auth-card p {
    margin: 0 0 12px;
}

.auth-card ul,
.auth-card ol {
    margin: 0 0 12px;
    padding-left: 1.3rem;
}

.auth-card ul {
    list-style: disc;
}

.auth-card h2,
.auth-card h3 {
    margin: 0 0 10px;
    color: var(--dtg-gold-pale);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
}

.auth-card a:not(.btn) {
    color: var(--dtg-gold-pale);
    text-decoration: underline;
    text-decoration-color: var(--gold-line);
    text-underline-offset: 3px;
}

.auth-card a:not(.btn):hover {
    color: #fff;
}

/* home.css makes every svg a block; these big page icons are centred with text-align in the views' own styles. */
.auth-card :is(.setup-icon, .success-icon, .verify-icon, .challenge-icon) svg {
    display: inline-block;
}

.form-intro {
    margin: 0 0 18px;
    color: var(--dtg-muted);
    text-align: center;
}

.form-text,
.form-help {
    display: block;
    margin-top: 6px;
    color: var(--dtg-muted);
    font-size: 0.82rem;
}

/* ---------- Flash messages (partials/alerts.php) ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.alert-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.alert ul {
    margin: 4px 0 0;
    padding-left: 1.2rem;
    list-style: disc;
}

.alert-success {
    color: #9BD8A3;
    background: rgba(95, 184, 106, 0.1);
    border-color: rgba(95, 184, 106, 0.4);
}

.alert-error {
    color: #F2A2A6;
    background: rgba(224, 67, 75, 0.1);
    border-color: rgba(224, 67, 75, 0.45);
}

.alert-warning {
    color: #EBCB8E;
    background: rgba(217, 164, 65, 0.1);
    border-color: rgba(217, 164, 65, 0.45);
}

.alert-info {
    color: var(--dtg-gold-pale);
    background: rgba(197, 161, 107, 0.08);
    border-color: var(--gold-line);
}

/* ---------- Registration / character wizard extras ---------- */

.choice-name {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

/* The homepage race and class portraits (images/home/races|classes) beside each choice. */
.choice-content.has-portrait {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-content: start;
    column-gap: 14px;
}

.choice-content.has-portrait > :not(.choice-portrait) {
    grid-column: 2;
}

.choice-portrait {
    grid-row: 1 / span 3;
    width: 64px;
    height: 77px;
    overflow: hidden;
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
}

.choice-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
}

.choice-card input:checked + .choice-content .choice-portrait {
    border-color: var(--dtg-gold);
}

/* The radio buttons are visually hidden inside the cards; show where keyboard focus is. */
.choice-card input:focus-visible + .choice-content {
    outline: 3px solid var(--dtg-gold-pale);
    outline-offset: 2px;
}
