﻿/* sm_accedi.css — Login + Registrazione SM48.
 * Layout pulito coerente con il pubblico SM48: sfondo bianco, Poppins 500,
 * accent rosso #e2001a. Card centrata, single column, mobile-first.
 * Self-contained (no master page) per offrire una "porta blindata" focalizzata.
 */

/* Poppins 500 self-hosted, identico al pubblico SM48 */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(/dist/fonts/poppins-500-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --sm-accent: #e2001a;
    --sm-accent-dark: #a3000f;
    --sm-accent-25: rgba(226, 0, 26, 0.18);
    --sm-surface: #ffffff;
    --sm-surface-alt: #f6f8fa;
    --sm-text: #202124;
    --sm-text-muted: #4b5563;
    --sm-line: #d9dee5;
    --sm-line-strong: #c8d0da;
    --sm-link: #1546a8;
}

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

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
    color: var(--sm-text);
    background: var(--sm-surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Sfondo soft compatibile col layout SM48 chiaro --- */

.sm-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 90% 110%, rgba(226, 0, 26, 0.06), transparent 60%),
        radial-gradient(ellipse at 10% -10%, rgba(226, 0, 26, 0.04), transparent 55%),
        var(--sm-surface);
}

/* Soft glow accent in basso a destra (decor leggero) */
.sm-stage__glow {
    position: absolute;
    width: 360px;
    height: 360px;
    bottom: -120px;
    right: -120px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(226, 0, 26, 0.10), transparent 70%);
    filter: blur(40px);
    opacity: 0.9;
}

/* --- Layout --- */

.sm-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 16px 48px;
}

.sm-brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-weight: 500;
    font-size: 19px;
    letter-spacing: -0.01em;
    margin-bottom: 28px;
    color: var(--sm-text);
}

.sm-brand a {
    color: var(--sm-text);
    text-decoration: none;
}

.sm-brand__accent {
    color: var(--sm-accent);
    font-weight: 500;
}

.sm-brand__sub {
    color: var(--sm-text-muted);
    font-weight: 500;
    font-size: 13px;
}

/* --- Card --- */

.sm-card {
    width: 100%;
    max-width: 440px;
    background: var(--sm-surface);
    color: var(--sm-text);
    border: 1px solid var(--sm-line);
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow:
        0 1px 2px rgba(16, 22, 36, 0.04),
        0 8px 24px rgba(16, 22, 36, 0.06);
    animation: sm-card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes sm-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sm-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sm-accent) 0%, var(--sm-accent-dark) 100%);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 8px 18px rgba(226, 0, 26, 0.22);
}

.sm-card__icon svg {
    width: 28px;
    height: 28px;
}

.sm-card__title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 500;
    text-align: center;
    line-height: 1.25;
}

.sm-card__sub {
    margin: 0 0 24px;
    text-align: center;
    color: var(--sm-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* --- Form --- */

.sm-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sm-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--sm-text);
}

.sm-field input[type="text"],
.sm-field input[type="email"],
.sm-field input[type="password"] {
    appearance: none;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--sm-line-strong);
    border-radius: 6px;
    background: var(--sm-surface);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--sm-text);
    transition: border-color 0.18s, box-shadow 0.18s;
}

.sm-field input:focus {
    outline: 0;
    border-color: var(--sm-accent);
    box-shadow: 0 0 0 3px var(--sm-accent-25);
}

.sm-field--error input {
    border-color: var(--sm-accent);
}

.sm-field__error {
    margin: 0;
    font-size: 12px;
    color: var(--sm-accent);
    display: none;
}

.sm-field__hint {
    margin: 0;
    font-size: 12px;
    color: var(--sm-text-muted);
    line-height: 1.4;
}

.sm-field--error .sm-field__error {
    display: block;
}

.sm-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    color: var(--sm-text-muted);
}

.sm-checkbox input {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--sm-accent);
}

.sm-checkbox a {
    color: var(--sm-link);
}

.sm-btn {
    appearance: none;
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--sm-accent);
    border-radius: 6px;
    background: var(--sm-accent);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.18s, border-color 0.18s, opacity 0.18s, box-shadow 0.18s;
}

.sm-btn:hover {
    background: var(--sm-accent-dark);
    border-color: var(--sm-accent-dark);
    box-shadow: 0 4px 10px rgba(226, 0, 26, 0.22);
}

.sm-btn:disabled {
    opacity: 0.7;
    cursor: progress;
    box-shadow: none;
}

.sm-btn[data-loading="true"]::after {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sm-spin 0.6s linear infinite;
    vertical-align: -2px;
}

@keyframes sm-spin { to { transform: rotate(360deg); } }

.sm-alert {
    display: none;
    margin: 14px 0 0;
    padding: 11px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.sm-alert--ok {
    display: block;
    background: #e9f7ee;
    color: #1b6b35;
    border: 1px solid #bde5cb;
}

.sm-alert--ko {
    display: block;
    background: #fbeaec;
    color: #9a0012;
    border: 1px solid #f4c2c8;
}

.sm-card__foot {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--sm-text-muted);
}

.sm-card__foot a {
    color: var(--sm-accent);
    text-decoration: none;
    font-weight: 500;
}

.sm-card__foot a:hover { text-decoration: underline; }

.sm-card__divider {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid var(--sm-line);
}

/* --- Variante card larga per la conferma iscrizione (form esteso) --- */

.sm-card--wide {
    max-width: 520px;
}

/* --- textarea (presentazione, ecc.) --- */

.sm-field textarea {
    appearance: none;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--sm-line-strong);
    border-radius: 6px;
    background: var(--sm-surface);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--sm-text);
    resize: vertical;
    min-height: 84px;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.sm-field textarea:focus {
    outline: 0;
    border-color: var(--sm-accent);
    box-shadow: 0 0 0 3px var(--sm-accent-25);
}

/* --- input disabilitati (email readonly nella conferma iscrizione) --- */

.sm-field input:disabled {
    background: var(--sm-surface-alt);
    color: var(--sm-text-muted);
    cursor: not-allowed;
}

/* --- "(opzionale)" hint inline accanto al label --- */

.sm-field__opt {
    font-weight: 500;
    font-size: 12px;
    color: var(--sm-text-muted);
    margin-left: 4px;
}

/* --- Mobile tweaks --- */

@media (max-width: 480px) {
    .sm-card { padding: 26px 20px; }
    .sm-brand { font-size: 17px; margin-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .sm-card { animation: none !important; }
}
