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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 15px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 25px;
    text-align: center;
    border-bottom: 3px solid #1e40af;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

main {
    padding: 25px;
    background: #fafbfc;
}

.shipping-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 8px 8px 0 0;
}

.form-section h2 {
    color: #1f2937;
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h2::before {
    content: '📦';
    font-size: 1.2rem;
}

.form-section:nth-child(2) h2::before { content: '📏'; }
.form-section:nth-child(3) h2::before { content: '🚚'; }
.form-section:nth-child(4) h2::before { content: '⚙️'; }

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-group input:hover,
.form-group select:hover {
    background: white;
    border-color: #9ca3af;
}

.help-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    background: #f3f4f6;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    background: white;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
    transform: scale(1.1);
}

.checkbox-group select,
.checkbox-group input[type="number"] {
    width: auto;
    min-width: 150px;
}

.checkbox-group input[type="number"]:disabled,
.checkbox-group select:disabled {
    background-color: #f1f3f4;
    color: #9aa0a6;
    cursor: not-allowed;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.calculate-btn,
.reset-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.calculate-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.calculate-btn::before {
    content: '🧮';
    font-size: 1rem;
}

.calculate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.reset-btn {
    background: #6b7280;
    color: white;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

.reset-btn::before {
    content: '🔄';
    font-size: 1rem;
}

.reset-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.result-section {
    margin-top: 20px;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    animation: slideIn 0.4s ease-out;
    border: 1px solid #1e3a8a;
    position: relative;
}

.result-section::before {
    content: '💰';
    position: absolute;
    top: -15px;
    left: 25px;
    background: #1e40af;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 1.2rem;
    border: 2px solid white;
}

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

.result-section h2 {
    margin-bottom: 25px;
    font-size: 1.6rem;
    text-align: center;
}

.cost-breakdown {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.2s ease;
}

.cost-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.cost-item:nth-child(1) { border-left-color: #3b82f6; }
.cost-item:nth-child(2) { border-left-color: #10b981; }
.cost-item:nth-child(3) { border-left-color: #f59e0b; }
.cost-item:nth-child(4) { border-left-color: #ef4444; }
.cost-item:nth-child(5) { border-left-color: #8b5cf6; }

.warning-item {
    background-color: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.weight-info {
    background-color: #dbeafe;
    border-left-color: #3b82f6;
    font-weight: 500;
    color: #1e40af;
}

.cost-item:last-child {
    margin-bottom: 0;
}

.cost-item.total {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 12px;
    padding: 15px 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-left: 4px solid #d97706;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.cost-item.total:hover {
    transform: translateX(0);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.cost-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cost-label::before {
    content: '•';
    color: #6b7280;
    font-weight: bold;
}

.cost-item.total .cost-label::before {
    content: '💰';
    font-size: 1rem;
}

.cost-value {
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.service-details {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.warning {
    background: #f39c12;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* Supplement Tables */
.supplement-tables {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    border: 1px solid #cbd5e1;
}

.supplement-tables h3 {
    color: #1e293b;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 600;
}

.supplement-table-container {
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.supplement-table-container h4 {
    color: #475569;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.supplement-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.supplement-table thead {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.supplement-table th,
.supplement-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.supplement-table th {
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.supplement-table tbody tr {
    transition: all 0.3s ease;
}

.supplement-table tbody tr:hover {
    background-color: #f1f5f9;
    transform: translateY(-1px);
}

.supplement-table tbody tr.current-supplement {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    font-weight: 600;
    color: #92400e;
}

.supplement-table tbody tr.current-supplement:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
}

.current-shipment-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #3b82f6;
}

.current-shipment-info h4 {
    color: #1e40af;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.shipment-details p {
    margin: 8px 0;
    color: #1e40af;
    font-size: 0.95em;
}

.shipment-details strong {
    color: #1e3a8a;
}

/* Credits e Sponsor Section */
.credits-section {
    margin-top: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 3px solid #007bff;
    border-radius: 10px 10px 0 0;
}

.credits {
    text-align: center;
    margin-bottom: 30px;
}

.credits p {
    font-size: 16px;
    color: #495057;
    margin: 0;
}

.sponsors {
    text-align: center;
}

.sponsors h3 {
    color: #343a40;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
}

.sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.sponsor-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.sponsor-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.sponsor-item a {
    color: #007bff;
    text-decoration: none;
    font-size: 18px;
    display: block;
    margin-bottom: 10px;
}

.sponsor-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.sponsor-item .slogan {
    font-style: italic;
    color: #6c757d;
    font-size: 14px;
    margin: 10px 0 0 0;
    line-height: 1.4;
}

.sponsor-item .description {
    color: #6c757d;
    font-size: 14px;
    margin: 10px 0 0 0;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .container {
        margin: 8px;
        border-radius: 8px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 15px;
    }
    
    .shipping-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .form-section h2 {
        font-size: 1.1rem;
    }
    
    .checkbox-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .checkbox-label {
        justify-content: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
        padding: 15px;
    }
    
    .calculate-btn,
    .reset-btn {
        width: 100%;
        min-width: auto;
    }
    
    .cost-breakdown {
        padding: 15px;
    }
    
    .cost-item {
        padding: 8px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .cost-item.total {
        flex-direction: row;
        align-items: center;
    }
    
    .sponsor-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .credits-section {
        margin-top: 20px;
        padding: 15px;
    }

    /* Supplement Tables Mobile */
    .supplement-tables {
        padding: 10px;
        margin-top: 20px;
    }

    .supplement-table-container {
        padding: 10px;
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .supplement-table {
        font-size: 0.75em;
        min-width: 100%;
        white-space: nowrap;
    }

    .supplement-table th,
    .supplement-table td {
        padding: 6px 8px;
        min-width: 80px;
    }

    .supplement-table th:first-child,
    .supplement-table td:first-child {
        min-width: 90px;
    }

    .supplement-table th:nth-child(2),
    .supplement-table td:nth-child(2) {
        min-width: 100px;
    }

    .supplement-table th:last-child,
    .supplement-table td:last-child {
        min-width: 80px;
    }

    .current-shipment-info {
        padding: 15px;
    }

    .shipment-details p {
        font-size: 0.85em;
        word-wrap: break-word;
    }

    .supplement-tables h3 {
        font-size: 1.2em;
    }

    .supplement-table-container h4 {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .checkbox-group select,
    .checkbox-group input[type="number"] {
        width: 100%;
        min-width: auto;
    }
}

/* Stili per la nota del pallet */
.pallet-note {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    animation: slideIn 0.3s ease-out;
}

.pallet-note p {
    margin: 0;
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.4;
}

.pallet-note strong {
    color: #78350f;
}

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