:root {
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --bg: #f4f7f6;
    --card-bg: #ffffff;
    --text: #333333;
    --border: #cccccc;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

h1 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    transition: border 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

.radio-group {
    display: flex;
    gap: 20px;
    padding: 5px 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input {
    width: auto;
}

button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

button:hover {
    background-color: var(--primary-hover);
}

.result-box {
    margin-top: 25px;
    padding: 15px;
    background: #e6f0fa;
    border-left: 5px solid var(--primary);
    border-radius: 4px;
    display: none;
    text-align: center;
}

.result-box h3 {
    font-size: 0.9rem;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.cf-display {
    font-size: 1.6rem;
    font-weight: bold;
    color: #004080;
    letter-spacing: 2px;
}

/* Ottimizzazioni per Mobile */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.5rem;
    }
    input, select, button {
        padding: 10px;
        font-size: 0.95rem;
    }
    .cf-display {
        font-size: 1.3rem;
    }
}

    /* Stile per i Tab */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    gap: 5px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #666;
    padding: 12px;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-top: 0; /* Sovrascrive il margine del bottone standard */
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: bold;
}

/* Gestione visibilità pannelli */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Bottone Copia e Lista Dati Inversi */
.copy-btn {
    background-color: #28a745;
    font-size: 0.9rem;
    padding: 8px;
    margin-top: 10px;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.copy-btn:hover { background-color: #218838; }

.info-list {
    text-align: left;
    margin-top: 10px;
}
.info-list p {
    margin-bottom: 8px;
    font-size: 1rem;
}
.warning-text {
    font-size: 0.8rem !important;
    color: #c0392b;
    margin-top: 15px;
}

.generator-container {
    max-width: 450px;
    margin: 20px auto;
    text-align: center;
}
.description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-primary:hover { background: #0056b3; }

/* La Card del Profilo */
.profile-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-top: 25px;
    padding: 20px;
    text-align: left;
}
.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.avatar {
    font-size: 2.5rem;
    background: #f0f2f5;
    padding: 10px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-info h3 { margin: 0 0 5px 0; color: #333; text-transform: uppercase; }
.user-info p { margin: 3px 0; color: #666; font-size: 0.9rem; }

/* Il Box del Codice Fiscale */
.cf-box {
    background: #e6f4ea; /* Verde chiaro o azzurro */
    border: 2px dashed #34a853;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cf-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    font-weight: bold;
    color: #137333;
    letter-spacing: 1px;
}
.btn-copy {
    background: #34a853;
    color: white;
    border: none;
    padding: 6px 12px;
    margin: 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}
.btn-copy:hover { background: #2b8a43; }