/* ===================================================
   Reset e Import Font Moderno (Inter)
   =================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0c16;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.45);
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

/* ===================================================
   Sfondo d'impatto con gradienti radiali
   =================================================== */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.1) 0px, transparent 65%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    line-height: 1.6;
}

/* ===================================================
   Titolo e Paragrafi Introduttivi
   =================================================== */
h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 70%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 2px 12px rgba(99, 102, 241, 0.3));
}

body > p {
    color: var(--text-muted);
    font-size: 1.05rem;
    text-align: center;
    margin-bottom: 2rem;
    max-width: 480px;
}

body > p em {
    color: #cbd5e1;
    font-style: italic;
    opacity: 0.85;
}

/* ===================================================
   Pulsanti High-Tech
   =================================================== */
button {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.85rem 1.8rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    letter-spacing: 0.02em;
}

/* Pulsante Principale "Ottieni" */
#ottieniInfo {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 20px var(--primary-glow);
    margin-bottom: 1.5rem;
}

#ottieniInfo:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.65);
}

#ottieniInfo:active {
    transform: translateY(0) scale(0.98);
}

/* Box pulisci e Pulsante Secondario "Pulisci" */
#pulisci {
    margin-top: 1.5rem;
    display: none;
}

#pulisci button {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#pulisci button:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.25);
}

#pulisci button:active {
    transform: translateY(0);
}

/* ===================================================
   Area Risultati (#info) - Card Leggibile e Ordinata
   =================================================== */
#info {
    width: 100%;
    max-width: 540px;
    min-height: 80px;
    margin: 1rem 0;
    padding: 1.5rem 1.75rem;
    
    /* Sfondo più scuro per un contrasto eccellente */
    background: rgba(13, 16, 32, 0.85); 
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.7);
    
    /* Testo e Allineamento */
    color: #f1f5f9; /* Bianco ghiaccio ad alta visibilità */
    font-family: 'Inter', system-ui, sans-serif; /* Font chiaro e leggibile */
    font-size: 1rem;
    line-height: 1.7;
    text-align: left; /* Allineamento naturale a sinistra */
    white-space: pre-line; /* Riconosce i a capo e le liste */
    word-break: break-word;
    
    /* Layout interno */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0.95;
    transition: all 0.3s ease;
}

/* Messaggio di placeholder (quando è vuoto o in attesa) */
#info:empty::before {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
    display: block;
}

/* Stile quando il box ha del testo */
#info:not(:empty) {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.3);
}

/* Ottimizzazione per liste o dettagli chiave-valore nel testo */
#info strong {
    color: var(--accent); /* Evidenzia le etichette con il colore azzurro neon */
    font-weight: 600;
}