:root {
    --brand: #7a1430;
    --text: #1a1a1a;
    --link: #111;
    --link-hover: #7a1430;
    --topbar-h: 118px;
    --container: 1240px;
    --muted: #6b6b6b;
    --card: #ffffff;
    --bg: #ffffff;
    --border: rgba(0, 0, 0, .08);
    --shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--link);
    text-decoration: none
}

a:hover {
    color: var(--link-hover)
}

.container {
    width: min(100%, calc(var(--container) + 40px));
    margin: 0 auto;
    padding: 0 20px;
}

.topbar {
    transform: translateY(-16px);
    opacity: 0;
    transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .6s ease;
}

body.is-loaded .topbar {
    transform: none;
    opacity: 1;
}

.page-intro {
    padding: clamp(28px, 4vw, 42px) 0 8px;
}

.page-intro h1 {
    font-family: "Playfair Display", serif;
    font-weight: 800;
    color: var(--brand);
    font-size: clamp(28px, 3.8vw, 44px);
    letter-spacing: .02em;
    margin: 0 0 8px;
}

.page-intro .underline {
    width: 72px;
    height: 3px;
    background: var(--brand);
    border-radius: 2px;
    opacity: .65;
}

.auth-wrap {
    padding: 8px 0 70px;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    max-width: 640px;
    margin: 22px auto 0;
    padding: clamp(22px, 3.6vw, 36px);
    animation: cardIn .5s ease-out both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(3px)
    }

    to {
        opacity: 1;
        transform: none;
        filter: none
    }
}

.login-card h2 {
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: clamp(20px, 2.2vw, 28px);
    margin: 0 0 18px;
    color: #3a3a3a;
}

.form-row {
    margin-bottom: 14px;
}

label.form-label {
    display: inline-block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    background: #fff;
}

.input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(122, 20, 48, .10);
}

.password-wrap {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    color: #555;
    border-radius: 8px;
}

.password-toggle:focus-visible {
    outline: 2px solid rgba(122, 20, 48, .35);
}

.form-row-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember input {
    width: 16px;
    height: 16px;
}

.cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 0;
    background: var(--brand);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform .05s ease, filter .2s ease, background .2s ease;
}

.cta:hover {
    filter: brightness(1.05);
}

.cta:active {
    transform: translateY(1px);
}

.alert {
    display: none;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(122, 20, 48, .25);
    color: #4b0e22;
    background: rgba(122, 20, 48, .06);
    border-radius: 10px;
}

.alert.is-visible {
    display: block;
}

.pill {
    display: none;
    margin: 10px 0 0;
    border: 1px dashed rgba(0, 0, 0, .15);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    color: var(--brand);
    background: rgba(122, 20, 48, .06);
}

.page-end-space {
    height: 24px
}

/* Linguette Accedi / Registrati: due pannelli, un solo indirizzo. */
.gate-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.gate-tabs button {
    flex: 1;
    border: 1px solid var(--brand);
    background: #fff;
    color: var(--brand);
    border-radius: 10px;
    padding: 10px;
    font-weight: 700;
    cursor: pointer;
}

.gate-tabs button.active {
    background: var(--brand);
    color: #fff;
}

.gate-panel {
    display: none;
}

.gate-panel.active {
    display: block;
}

.consensi {
    margin: 1rem 0 1.5rem;
    font-size: 13px;
    color: #555;
}

.consensi label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.consensi label+label {
    margin-top: 10px;
}

.consensi input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.consensi a {
    color: var(--brand);
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    .topbar {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .login-card {
        transition: none !important;
        animation: none !important;
    }
}