/* Reset e variabili */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 50px;
    width: 50px;
    object-fit: contain;
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-admin-link {
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-admin-link:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

/* Welcome Card */
.welcome-card {
    background: white;
    border-radius: var(--radius);
    padding: 60px 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.welcome-icon {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.welcome-content h2 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.welcome-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.choice-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.btn-choice {
    padding: 30px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.btn-choice:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.btn-choice.btn-primary {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-choice.btn-secondary {
    border-color: var(--secondary-color);
}

.btn-choice.btn-secondary:hover {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: white;
}

.btn-choice i {
    font-size: 48px;
}

.btn-choice span {
    font-size: 20px;
    font-weight: 600;
}

.btn-choice small {
    font-size: 14px;
    opacity: 0.8;
}

/* Form Container */
.form-container {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 20px;
    transition: var(--transition);
}

.btn-back:hover {
    color: var(--primary-color);
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.form-header h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-step h3 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-step h4 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 30px 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input.error {
    border-color: var(--danger-color);
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.form-hint.success {
    color: var(--success-color);
    font-weight: 600;
}

.form-hint.error {
    color: var(--danger-color);
    font-weight: 600;
}

/* Tipologie */
.tipologie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tipologia-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    transition: var(--transition);
    cursor: pointer;
    background: white;
}

.tipologia-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.tipologia-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
}

.tipologia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tipologia-header h4 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}

.tipologia-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.tipologia-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-select {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-select:hover {
    background: var(--primary-dark);
}

/* Summary Box */
.summary-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 25px;
    margin-top: 30px;
}

.summary-box h4 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.highlight {
    background: white;
    padding: 15px;
    margin: 10px -10px;
    border-radius: 8px;
    border: none;
}

.summary-label {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-value {
    color: var(--text-secondary);
    text-align: right;
}

.summary-row.highlight .summary-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

/* Search Results */
.search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.search-no-results i {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.search-result-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 25px;
    margin-top: 20px;
    border: 2px solid var(--border-color);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h4 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0;
}

.result-info p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.result-info strong {
    color: var(--text-primary);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-waiting {
    background: #fef3c7;
    color: #92400e;
}

.badge-approved {
    background: #d1fae5;
    color: #065f46;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.badge-paid {
    background: #dbeafe;
    color: #1e40af;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 50px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.4s ease;
}

.modal-success {
    border-top: 5px solid var(--success-color);
}

.success-icon {
    font-size: 80px;
    color: var(--success-color);
    margin-bottom: 20px;
}

.modal-content h2 {
    font-size: 26px;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal-content p.highlight {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-weight: 500;
    color: var(--text-primary);
    margin: 20px 0;
}

.modal-content .btn {
    margin-top: 20px;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: var(--transition);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

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

.toast i {
    font-size: 20px;
}

.toast-success i {
    color: var(--success-color);
}

.toast-error i {
    color: var(--danger-color);
}

.toast-info i {
    color: var(--primary-color);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .welcome-card {
        padding: 40px 20px;
    }
    
    .welcome-icon {
        font-size: 60px;
    }
    
    .welcome-content h2 {
        font-size: 24px;
    }
    
    .choice-buttons {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 30px 20px;
    }
    
    .progress-steps {
        flex-wrap: wrap;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .tipologie-grid {
        grid-template-columns: 1fr;
    }
    
    .form-navigation {
        flex-direction: column;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        min-width: auto;
    }
}