:root {
    --base-color: white;
    --base-variant: #e8e9ed;
    --text-color: #111528;
    --secondary-text: #232738;
    --primary-color: #3a435d;
    --accent-color: #0071ff;
}

.darkmode {
    --base-color: #070b1d;
    --base-variant: #101425;
    --text-color: #ffffff;
    --secondary-text: #a4a5b8;
    --primary-color: #3a435d;
    --accent-color: #0071ff;
}

* {
    margin: 0;
    padding: 0;  
}

html {
    font-family: Poppins, Arial, sans-serif; /* Aggiunto Arial come fallback */
}

body {
    min-height: 100vh;
    background-color: var(--base-color); /* Usa il colore di sfondo definito */
    color: var(--text-color); /* Usa il colore del testo definito */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

header, section {
    padding: 70px min(50px, 7%);
}

h2 {
    text-align: center;
    color: var(--text-color); /* Colore del testo che cambia */
    margin-bottom: 20px; /* Spazio extra sopra il form */
}

.card {
    margin: 0 auto;
    padding: 2em;
    width: 300px;
    background: var(--base-variant); /* Usa il colore di sfondo del form */
    text-align: center;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.card::after, .card::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    background-image: conic-gradient(from var(--angle), #ff4545, #00ff99, #006aff, #ff0095, #ff4545);
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    z-index: -1;
    padding: 3px;
    border-radius: 10px;
    animation: 3s spin linear infinite;
}

.card::before {
    filter: blur(1.5rem);
    opacity: 0.5;
}

@keyframes spin {
    from {
        --angle: 0deg;
    }
    to {
        --angle: 360deg;
    }
}

label {
    color: var(--secondary-text);
    display: block;
    margin-bottom: 5px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
    box-sizing: border-box; /* Assicura che padding e bordi siano inclusi nella larghezza */
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box; /* Assicura che padding e bordi siano inclusi nella larghezza */
}

button:hover {
    background-color: #4a54e1; /* Colore hover */
}

p {
    text-align: center;
    color: var(--secondary-text);
    margin-top: 20px; /* Spazio tra il form e il messaggio di registrazione */
}

a {
    color: var(--primary-color);
}

a:hover {
    text-decoration: underline;
}

#theme-switch {
    height: 50px;
    width: 50px;
    padding: 0;
    border-radius: 50%;
    background-color: var(--base-variant);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 20px;
    right: 20px;
}

#theme-switch svg {
    fill: var(--primary-color);
}

#theme-switch svg:last-child {
    display: none;
}

.darkmode #theme-switch svg:first-child {
    display: none;
}

.darkmode #theme-switch svg:last-child {
    display: block;
}
