/* ============================================================
   TOURNIVOX - Auth pages (login / register)
   ============================================================ */

:root {
    --maroon-950: #260009;
    --maroon-800: #5b0018;
    --maroon-700: #72001e;
    --maroon-600: #8d0b2d;
    --gold: #f3b61f;
    --gold-bright: #ffd45a;
    --green: #1f7a4d;
    --green-bright: #4ed28b;

    --text: #ffffff;
    --text-soft: #cfc8c5;
    --text-muted: #aaa4a0;
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-gold: rgba(243, 182, 31, 0.35);

    --font: "Segoe UI", Arial, Helvetica, sans-serif;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(rgba(24, 0, 7, 0.82), rgba(8, 6, 7, 0.94)),
        url("../assets/images/tournivox-banner.png") center / cover fixed,
        linear-gradient(135deg, var(--maroon-950) 0%, var(--maroon-800) 42%, var(--green) 100%);
}

/* ---------- Card ---------- */

.auth-shell {
    width: min(470px, 100%);
    background: rgba(23, 16, 17, 0.94);
    border: 1px solid var(--border-gold);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: authIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-topline {
    height: 5px;
    background: linear-gradient(90deg, var(--maroon-700), var(--gold), var(--green));
}

.auth-panel {
    padding: 40px;
}

/* ---------- Brand ---------- */

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    width: 104px;
    height: 104px;
    object-fit: contain;
    display: block;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: #ffffff;
    padding: 4px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.auth-brand h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: 2px;
    color: var(--gold-bright);
}

.auth-brand h2 {
    margin: 8px 0 0;
    font-size: 24px;
}

.auth-brand p {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* ---------- Alerts ---------- */

.auth-alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.auth-alert-success {
    background: rgba(31, 122, 77, 0.18);
    border: 1px solid rgba(78, 210, 139, 0.45);
    color: #b8f5d4;
}

.auth-alert-error {
    background: #531520;
    border: 1px solid #b93b54;
    color: #ffe5e9;
}

/* ---------- Fields ---------- */

.auth-field {
    display: block;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 700;
}

.auth-field input {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 14px 15px;
    border: 1px solid #4d3439;
    border-radius: 11px;
    background: #100b0c;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(243, 182, 31, 0.12);
}

.password-wrap {
    position: relative;
    display: block;
}

.password-wrap input {
    padding-right: 72px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: calc(50% + 4px);
    transform: translateY(-70%);
    padding: 6px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #000000;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
}


.password-toggle:hover {
    background: rgba(243, 182, 31, 0.1);
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: -4px 0 20px;
    font-size: 14px;
    color: var(--text-soft);
    cursor: pointer;
}

.auth-remember input {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}

/* ---------- Button ---------- */

.auth-button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-bottom: 3px solid var(--gold);
    border-radius: 11px;
    background: linear-gradient(135deg, var(--maroon-700), var(--maroon-600));
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.auth-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.auth-button:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.auth-button:hover::after {
    left: 140%;
}

/* ---------- Links ---------- */

.auth-links {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-muted);
}

.auth-links a {
    color: var(--gold-bright);
    font-weight: 800;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ---------- Animation ---------- */

@keyframes authIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 520px) {
    body {
        padding: 16px;
    }

    .auth-panel {
        padding: 28px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Already signed in ---------- */

.auth-signed-in {
    display: grid;
    gap: 4px;
    margin-bottom: 20px;
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(78, 210, 139, 0.35);
    border-radius: 12px;
    background: rgba(31, 122, 77, 0.12);
}

.auth-signed-label {
    color: var(--green-bright);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 2px;
}

.auth-signed-in strong {
    font-size: 18px;
}

.auth-signed-in small {
    color: var(--text-muted);
    font-size: 13px;
}

.auth-button-link {
    display: grid;
    place-items: center;
    text-decoration: none;
}

.auth-button:disabled {
    cursor: wait;
    filter: grayscale(0.4) brightness(0.85);
    transform: none;
}

[hidden] {
    display: none !important;
}

/* ---------- Register ---------- */

.auth-shell-wide {
    width: min(560px, 100%);
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field-message {
    display: block;
    min-height: 0;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
}

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

.field-message.error   { color: #ffb3c1; }
.field-message.success { color: #b8f5d4; }

.auth-field input.is-invalid {
    border-color: #b93b54;
}

.auth-hint {
    margin: -6px 0 18px;
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 520px) {
    .auth-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
