/* =========================================================
   LOGIN ALUNNO
   ========================================================= */

:root {
    --ink: #15171f;
    --red: #e8432f;
    --red-dark: #8c2118;
    --yellow: #ffc93c;
    --paper: #faf6ec;
    --paper-dark: #f4e7d6;
    --white: #ffffff;
    --muted: #6b6e7b;

    --radius: 14px;

    --shadow-sm: 4px 4px 0 var(--ink);
    --shadow-md: 7px 7px 0 var(--ink);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    background: var(--paper);
    color: var(--ink);

    font-family: "Inter", Arial, sans-serif;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px 20px;

    -webkit-font-smoothing: antialiased;

    overflow-x: hidden;
}


/* =========================================================
   NESSUN PALLINO / DECORAZIONE DI SFONDO
   ========================================================= */

body::before,
body::after {
    display: none !important;
    content: none !important;
}


/* =========================================================
   CARD
   ========================================================= */

.login-card {
    position: relative;

    width: 100%;
    max-width: 460px;

    background: var(--white);

    border: 3px solid var(--ink);
    border-radius: var(--radius);

    padding: 34px;

    box-shadow: var(--shadow-md);
}


/* =========================================================
   LOGO GRANDE
   ========================================================= */

.login-card .logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    /*
       Spazio molto più grande per il logo
       così non tocca il titolo.
    */
    height: 235px;

    margin: 0 0 20px;

    padding: 0;

    background: transparent;

    line-height: 0;

    overflow: visible;
}

.login-card .logo img {
    display: block !important;

    width: 220px !important;
    height: 220px !important;

    min-width: 220px !important;
    min-height: 220px !important;

    max-width: 220px !important;
    max-height: 220px !important;

    object-fit: contain !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;

    transform: none !important;
    float: none !important;

    border: 0 !important;
    outline: 0 !important;

    background: transparent !important;

    box-shadow: none !important;
}


/* =========================================================
   TITOLO
   ========================================================= */

.login-card h1 {
    margin: 0;

    text-align: center;

    font-family: "Archivo Black", Arial, sans-serif;

    font-size: 2rem;

    line-height: 1.05;

    letter-spacing: -0.02em;
}


/* =========================================================
   SOTTOTITOLO
   ========================================================= */

.subtitle {
    margin: 10px 0 26px;

    text-align: center;

    color: var(--muted);

    font-size: 0.92rem;

    line-height: 1.45;
}


/* =========================================================
   ERRORE
   ========================================================= */

.errore {
    margin-bottom: 18px;

    padding: 12px 14px;

    background: #fff0ed;

    color: var(--red-dark);

    border: 2px solid var(--red);

    border-radius: 9px;

    font-size: 0.88rem;

    font-weight: 600;

    text-align: center;
}


/* =========================================================
   FORM
   ========================================================= */

form {
    width: 100%;

    margin: 0;

    padding: 0;
}


/* =========================================================
   LABEL
   ========================================================= */

label {
    display: block;

    margin: 16px 0 0;

    color: var(--ink);

    font-family: "Space Grotesk", Arial, sans-serif;

    font-size: 0.78rem;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.06em;
}

label:first-of-type {
    margin-top: 0;
}


/* =========================================================
   INPUT
   ========================================================= */

input {
    display: block;

    width: 100%;
    height: 48px;

    margin: 6px 0 0;

    padding: 10px 13px;

    background: var(--paper);

    color: var(--ink);

    border: 2px solid var(--ink);

    border-radius: 9px;

    outline: none;

    font-family: "Space Grotesk", Arial, sans-serif;

    font-size: 16px;

    transition:
        background 0.12s ease,
        box-shadow 0.12s ease;
}

input::placeholder {
    color: #999a9f;
}

input:focus {
    background: var(--white);

    box-shadow: 4px 4px 0 var(--yellow);
}


/* =========================================================
   CODICE ALUNNO
   ========================================================= */

input[name="codice"] {
    text-transform: uppercase;

    letter-spacing: 0.08em;

    font-weight: 700;
}


/* =========================================================
   BOTTONE
   ========================================================= */

button {
    display: block;

    width: 100%;
    height: 48px;

    margin: 22px 0 0;

    padding: 10px 18px;

    background: var(--red);

    color: var(--white);

    border: 3px solid var(--ink);

    border-radius: 9px;

    box-shadow: var(--shadow-sm);

    font-family: "Space Grotesk", Arial, sans-serif;

    font-size: 0.94rem;

    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease;
}

button:hover {
    background: var(--red-dark);

    transform: translate(2px, 2px);

    box-shadow: 2px 2px 0 var(--ink);
}

button:active {
    transform: translate(4px, 4px);

    box-shadow: none;
}


/* =========================================================
   SUGGERIMENTO
   ========================================================= */

.hint {
    margin: 20px 0 0;

    padding: 12px 14px;

    background: var(--paper-dark);

    border: 2px dashed #b9aa96;

    border-radius: 9px;

    color: var(--muted);

    font-size: 0.8rem;

    line-height: 1.4;

    text-align: center;
}


/* =========================================================
   ACCESSIBILITÀ
   ========================================================= */

button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 520px) {

    body {
        padding: 20px 14px;
    }

    .login-card {
        max-width: 400px;

        padding: 28px 20px;

        box-shadow: 5px 5px 0 var(--ink);
    }

    .login-card .logo {
        height: 185px;

        margin-bottom: 18px;
    }

    .login-card .logo img {
        width: 170px !important;
        height: 170px !important;

        min-width: 170px !important;
        min-height: 170px !important;

        max-width: 170px !important;
        max-height: 170px !important;
    }

    .login-card h1 {
        font-size: 1.7rem;
    }

    .subtitle {
        margin-bottom: 22px;
    }
}


/* =========================================================
   TELEFONI MOLTO PICCOLI
   ========================================================= */

@media (max-width: 360px) {

    body {
        padding: 14px 10px;
    }

    .login-card {
        padding: 24px 16px;
    }

    .login-card .logo {
        height: 160px;

        margin-bottom: 16px;
    }

    .login-card .logo img {
        width: 145px !important;
        height: 145px !important;

        min-width: 145px !important;
        min-height: 145px !important;

        max-width: 145px !important;
        max-height: 145px !important;
    }

    .login-card h1 {
        font-size: 1.55rem;
    }
}


/* Migliorie per telefoni: campi e pulsanti comodi da toccare. */
@media (max-width: 520px) {
    html { -webkit-text-size-adjust: 100%; }
    body { min-height: 100dvh; align-items: flex-start; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
    .login-card { width: 100%; max-width: 440px; margin: auto; }
    .login-card form { width: 100%; }
    .login-card input, .login-card button { min-height: 48px; font-size: 16px; }
    .login-card button { width: 100%; }
}
