:root {
    --primary-color: #2b6cb0;
    --primary-hover: #2c5282;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Decorations */
.background-decor {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(66, 153, 225, 0.1) 0%, rgba(255,255,255,0) 70%);
    top: -200px;
    left: -200px;
    z-index: -1;
    border-radius: 50%;
}

.background-decor.decor-2 {
    top: auto;
    bottom: -200px;
    right: -200px;
    left: auto;
    background: radial-gradient(circle, rgba(66, 153, 225, 0.08) 0%, rgba(255,255,255,0) 70%);
}

.container {
    max-width: 800px;
    width: 100%;
    z-index: 1;
}

.main-content-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

/* Header */
.page-header {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    align-items: end;
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease-out;
}

.page-header.user-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.logo-container {
    flex-shrink: 0;
}

.logo-img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: contain;
    background-color: white;
    box-shadow: var(--shadow-md);
}

.badge {
    background-color: #ebf8ff;
    color: #3182ce;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.header-titles h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
}

.info-card {
    border-top: 4px solid var(--primary-color);
}

/* Information Section */
.dynamic-info-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.dynamic-info-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #1a202c;
}

.info-content {
    color: var(--text-main);
    font-size: 0.95rem;
    text-align: justify;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-content ol, .info-content ul {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.info-content p {
    margin-bottom: 0.5rem;
}

#istruzioni-content {
    background-color: #f0fdf4; /* Verde tenue */
    border-left-color: #16a34a;
}

#informazioni-content {
    background-color: #ebf8ff; /* Blu tenue */
    border-left-color: #3182ce;
}

#contatti-content {
    background-color: #fffaf0; /* Arancio tenue */
    border-left-color: #dd6b20;
}

/* Interaction Section */
.instructions h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #1a202c;
}

.steps-list {
    margin-left: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.steps-list li {
    margin-bottom: 0.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-color);
    background: transparent;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    border-color: #cbd5e0;
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 14px 0 rgba(43, 108, 176, 0.39);
}

/* Forms */
.forms-container {
    position: relative;
    overflow: hidden;
}

.form-view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.form-view.active {
    display: block;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .input-group {
    flex: 1;
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #fdfdfd;
}

#reg-nome, #reg-cognome, #log-nome, #log-cognome {
    text-transform: uppercase;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
    background-color: white;
}

.primary-btn {
    width: 100%;
    padding: 0.9rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.25);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    width: 100%;
    padding: 0.9rem;
    background-color: #38a169; /* Verde */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.secondary-btn:hover {
    background-color: #2f855a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.25);
}

.secondary-btn:active {
    transform: translateY(0);
}

.tab-btn.active#tab-login {
    background: #38a169;
    border-color: #38a169;
    box-shadow: 0 4px 14px 0 rgba(56, 161, 105, 0.39);
}

.form-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.form-message.error { color: #e53e3e; }
.form-message.success { color: #38a169; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.6s ease-out 0.2s both; }
.slide-up { animation: fadeIn 0.6s ease-out 0.4s both; }

/* Responsive */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .page-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .page-header.user-header > div:last-child {
        margin: 0 auto !important;
    }
    .tabs {
        flex-direction: column;
    }
}

@media (min-width: 900px) {
    .container {
        max-width: 1400px;
    }
    .main-content-grid, .page-header:not(.user-header) {
        grid-template-columns: 1fr 1.2fr;
    }
}
