/* ===== InnCloud - pagine di accesso =====
   Stile sobrio: fondo scuro neutro e statico, logo Innovit bianco, riquadro centrato. Verde brand #00927A solo per
   pulsante, focus e link. Nessuna animazione oltre all'indicatore di invio. */
:root {
    /* Colori del logo Innovit */
    --innovit-blue: #1a3a5b;
    --innovit-green: #00927A;
    --auth-primary: var(--innovit-green);
    --auth-primary-hover: #007f6a;
    --auth-primary-light: #1fb394;
    --auth-bg: #14181b;
    --auth-surface: #1c2125;
    --auth-border: #2b3237;
    --auth-input: #15191c;
    --auth-text: #e8ecee;
    --auth-muted: #8f9aa1;
    --auth-danger: #f28b82;
    --auth-font: 'Roboto', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

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

html, body { height: 100%; margin: 0; }

body.auth-body {
    font-family: var(--auth-font);
    color: var(--auth-text);
    /* Sfumatura statica che parte da destra con i colori del logo Innovit (verde → blu → fondo scuro) */
    background-color: var(--auth-bg);
    background-image:
        radial-gradient(ellipse 70% 90% at 100% 100%, rgba(0, 146, 122, 0.45), transparent 70%),
        linear-gradient(270deg, var(--innovit-blue) 0%, rgba(26, 58, 91, 0.55) 35%, var(--auth-bg) 75%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* ----- Struttura ----- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 1.25rem;
}

.auth-logo {
    display: block;
    width: 132px;
    height: auto;
    margin: auto 0 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.auth-title {
    margin: 0 0 0.3rem;
    font-size: 1.35rem;
    font-weight: 500;
}

.auth-subtitle {
    margin: 0 0 1.5rem;
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ----- Form ----- */
.auth-form { display: grid; gap: 1rem; }

.auth-field { display: grid; gap: 0.4rem; }

.auth-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--auth-muted);
}

.auth-input-wrap { position: relative; }

.auth-input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-muted);
    pointer-events: none;
}

.auth-input {
    width: 100%;
    height: 44px;
    padding: 0 0.9rem 0 2.6rem;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-input);
    color: var(--auth-text);
    font: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input::placeholder { color: #5f6a71; }

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(0, 146, 122, 0.2);
}

.auth-input.has-toggle { padding-right: 2.9rem; }

.auth-input.is-code {
    padding-left: 0.9rem;
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.35em;
    font-variant-numeric: tabular-nums;
}

.auth-input.input-validation-error { border-color: var(--auth-danger); }

/* Riempimento automatico del browser: mantiene i colori scuri */
.auth-input:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-input) inset;
    caret-color: var(--auth-text);
}

.auth-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-toggle:hover { color: var(--auth-text); }
.auth-toggle:focus-visible { outline: 2px solid var(--auth-primary); outline-offset: 1px; }
.auth-toggle .icon-hide { display: none; }
.auth-toggle.is-visible .icon-show { display: none; }
.auth-toggle.is-visible .icon-hide { display: block; }

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-submit {
    position: relative;
    height: 44px;
    margin-top: 0.25rem;
    border: 0;
    border-radius: 8px;
    background: var(--auth-primary);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

.auth-submit:hover { background: var(--auth-primary-hover); }
.auth-submit:focus-visible { outline: 2px solid var(--auth-primary-light); outline-offset: 2px; }
.auth-submit:disabled { cursor: progress; }

.auth-submit.is-loading { color: transparent; }
.auth-submit.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

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

/* ----- Messaggi ----- */
.validation-summary-valid { display: none; }

.validation-summary-errors {
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(242, 139, 130, 0.35);
    border-left-width: 3px;
    border-radius: 8px;
    background: rgba(242, 139, 130, 0.08);
    color: #f6c1bc;
    font-size: 0.88rem;
}

.validation-summary-errors ul { margin: 0; padding: 0; list-style: none; }

.field-validation-error { color: var(--auth-danger); font-size: 0.8rem; }
.field-validation-valid { display: none; }

.auth-note {
    margin: 1.5rem 0 0;
    color: var(--auth-muted);
    font-size: 0.85rem;
    text-align: center;
}

.auth-link { color: var(--auth-primary-light); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-icon-badge {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 0 1rem;
    border-radius: 50%;
    color: var(--auth-primary-light);
    background: rgba(0, 146, 122, 0.12);
}

.auth-footer {
    margin: auto 0 0;
    padding-top: 2rem;
    color: #5f6a71;
    font-size: 0.75rem;
    text-align: center;
}

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem 1.25rem; }
    .auth-logo { width: 110px; margin-bottom: 1.5rem; }
}
