/**
 * VanService Booking Wizard Styles
 */

/* CSS Variables - VanService Brand Colors */
:root {
    --primary-color: #043c89;
    --secondary-color: #27d400;
    --text-color: #000222;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-gray: #dee2e6;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.15);
}

/* Accessibilità - Riduzione movimento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Reset e Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0552b5 100%);
    min-height: 100vh;
    padding: 0 20px 40px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 40px;
    animation: fadeInDown 0.8s ease;
}

.page-header h1 {
    color: white;
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    margin: 15px 0 12px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.page-header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(16px, 3.5vw, 18px);
    font-weight: 500;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.booking-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    padding: clamp(20px, 5vw, 60px) clamp(20px, 6vw, 60px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 20px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--secondary-color);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 30px;
}

/* Wizard Steps */
.wizard-step {
    display: none;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-step.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wizard-step h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 32px;
    font-weight: 700;
}

.wizard-step > p {
    color: #718096;
    font-size: 16px;
    margin-bottom: 35px;
    line-height: 1.6;
}

/* Form Elements */
.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #2d3748;
    font-weight: 600;
    font-size: 15px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #a0aec0;
    font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f7fafc;
    color: #2d3748;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(4, 60, 137, 0.1);
    transform: translateY(-2px);
}

.form-group input.error,
.form-group select.error {
    border-color: #fc8181;
    background: #fff5f5;
}

.field-error {
    color: #e53e3e;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.field-error::before {
    content: '⚠';
    font-size: 14px;
}

/* Checkbox e Privacy */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(102, 126, 234, 0.05);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-label span {
    color: #4a5568;
    line-height: 1.5;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.checkbox-label a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(4, 60, 137, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(4, 60, 137, 0.5);
}

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

.btn-primary:disabled {
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 40px;
}

#btn-check-coverage {
    background: var(--secondary-color);
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(39, 212, 0, 0.4);
}

#btn-check-coverage:hover {
    background: #20b000;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 212, 0, 0.5);
}

/* Coverage Check */
.coverage-check {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 35px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
}

.coverage-result {
    margin-top: 20px;
    padding: 18px 22px;
    border-radius: 12px;
    font-weight: 500;
    animation: slideDown 0.4s ease;
}

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

.coverage-result.success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border: 2px solid #68d391;
}

.coverage-result.error {
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    color: #742a2a;
    border: 2px solid #f56565;
}

/* Defects List */
.defects-list {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.defect-item {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    padding: 18px 20px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.defect-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(4, 60, 137, 0.15);
    transform: translateY(-2px);
}

.defect-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.defect-item input[type="checkbox"] {
    margin-right: 15px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.defect-item input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

.defect-item .price {
    font-weight: 700;
    font-size: 17px;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Total */
.total-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 28px 32px;
    border-radius: 16px;
    margin-top: 35px;
    box-shadow: 0 10px 30px rgba(4, 60, 137, 0.3);
}

.total-section h3 {
    margin: 0 0 12px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-amount {
    font-size: 42px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.total-section small {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

/* Summary */
.booking-summary {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.summary-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 2px solid #e2e8f0;
}

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

.summary-section h4 {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.summary-section p {
    color: #2d3748;
    font-size: 16px;
    margin: 8px 0;
    line-height: 1.6;
}

.total-price {
    font-size: 38px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 60, 137, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

#loading-overlay .spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

#loading-overlay p {
    color: white;
    margin-top: 25px;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */

/* Desktop Large (1025px+) */
@media (min-width: 1025px) {
    body {
        padding: 0 20px 40px 20px;
    }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    body {
        padding: 20px;
    }

    .booking-container {
        border-radius: 20px;
    }

    .wizard-step h2 {
        font-size: 28px;
    }
}

/* Smartphone Large (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    body {
        padding: 15px;
    }

    .booking-container {
        border-radius: 16px;
    }

    .wizard-step h2 {
        font-size: 24px;
    }

    .button-group {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        padding: 14px 24px;
    }
}

/* Smartphone Small (≤480px) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .booking-container {
        border-radius: 12px;
    }

    .wizard-step h2 {
        font-size: 22px;
    }

    .wizard-step p {
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
    }

    .total-amount {
        font-size: 32px;
    }

    .defect-item label {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 14px;
    }

    .progress-text {
        font-size: 13px;
    }
}

/* Legacy breakpoint mantenuto per compatibilità */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

    .booking-container {
        border-radius: 20px;
    }

    .wizard-step h2 {
        font-size: 26px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .total-amount {
        font-size: 36px;
    }

    .defect-item label {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Alert Messages */
.alert {
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 500;
    border: 2px solid;
    animation: slideDown 0.4s ease;
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border-color: #68d391;
}

.alert-error {
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    color: #742a2a;
    border-color: #f56565;
}

.alert-info {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    color: #2c5282;
    border-color: #63b3ed;
}

.alert-warning {
    background: linear-gradient(135deg, #fef5e7 0%, #fce181 100%);
    color: #744210;
    border-color: #f0ad4e;
}

.alert strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

/* IMEI Result Styling */
.imei-result {
    animation: slideDown 0.4s ease;
}

.imei-result .alert {
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Warranty Result Styling */
.warranty-result {
    animation: slideDown 0.4s ease;
    margin-top: 20px;
}

.warranty-result .alert {
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Address Field Slide Animation */
#address-field {
    animation: slideDown 0.5s ease;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.alert ol, .alert ul {
    margin-top: 10px;
}

/* Additional Enhancements */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
    position: relative;
    cursor: pointer;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

input[type="checkbox"]:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(4, 60, 137, 0.1);
}

/* Smooth transitions for interactive elements */
button, input, select, textarea, a, .defect-item, .btn, .checkbox-label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 3px solid rgba(4, 60, 137, 0.5);
    outline-offset: 2px;
}

/* Placeholder styling */
::placeholder {
    color: #a0aec0;
    opacity: 1;
}

/* Selection styling */
::selection {
    background: rgba(4, 60, 137, 0.3);
    color: #2d3748;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 2, 34, 0.97);
    color: #fff;
    padding: 20px;
    z-index: 99999;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.3);
    border-top: 3px solid var(--secondary-color);
    transform: translateY(100%);
    transition: transform 0.4s ease-out;
}

#cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text h4 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.cookie-banner-text p {
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
    color: #ccc;
}

.cookie-banner-text a {
    color: var(--secondary-color);
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cookie-btn-accept {
    background: var(--secondary-color);
    color: #000;
}

.cookie-btn-accept:hover {
    background: #1fb800;
    transform: translateY(-2px);
}

.cookie-btn-reject {
    background: transparent;
    color: #fff;
    border: 2px solid #666;
}

.cookie-btn-reject:hover {
    border-color: #999;
    background: rgba(255,255,255,0.05);
}

.cookie-btn-settings {
    background: transparent;
    color: #999;
    border: none;
    text-decoration: underline;
}

.cookie-btn-settings:hover {
    color: #fff;
}

#cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: 3px solid var(--secondary-color);
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0);
}

#cookie-settings-btn.show {
    opacity: 1;
    transform: scale(1);
}

#cookie-settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
    #cookie-banner {
        padding: 15px;
    }

    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner-buttons {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }

    #cookie-settings-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 15px;
        left: 15px;
    }
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(20px);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

header .logo {
    max-height: 55px;
    width: auto;
}

.header-cta {
    background: var(--secondary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.header-cta:hover {
    background: #20b000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39,212,0,0.3);
}

/* Footer Styles */
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-content {
    text-align: center;
    margin-bottom: 30px;
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.footer-logo {
    max-height: 50px;
    margin-bottom: 30px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-content p {
    margin-bottom: 10px;
    line-height: 1.8;
    opacity: 0.9;
}

.footer-content a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-content a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-legal {
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 15px 20px 0;
}

.footer-legal a {
    color: #aaa;
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.8;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.footer-bottom a {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for header/footer */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    footer {
        padding: 40px 0 20px;
    }

    .footer-content p {
        font-size: 0.9em;
    }
}

/* Device Types Selection Grid */
.device-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.device-type-card {
    background: white;
    border: 2px solid var(--border-gray);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.device-type-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(4, 60, 137, 0.15);
}

.device-type-card.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0552b5 100%);
    border-color: var(--primary-color);
    color: white;
}

.device-type-card .icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.device-type-card.selected .icon {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.device-type-card .device-type-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.device-type-card.selected .device-type-img {
    /* Keep image visible when selected - no filter */
    opacity: 1;
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.device-type-card .name {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.device-type-card.selected .name {
    color: white;
}

.device-type-card .checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.device-type-card.selected .checkmark {
    display: flex;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: var(--primary-color);
    font-size: 16px;
}

@media (max-width: 768px) {
    .device-types-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .device-type-card {
        padding: 15px;
    }

    .device-type-card .icon {
        font-size: 36px;
    }

    .device-type-card .name {
        font-size: 12px;
    }
}

/* Proof of Purchase Upload (Step 4) */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.upload-preview {
    margin-top: 15px;
    padding: 15px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
}

.upload-preview p {
    margin: 0 0 10px 0;
}

.upload-preview #file-name {
    font-weight: 600;
    color: var(--primary-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================
   SYMPTOMS STEP STYLES (NEW)
   ============================================ */

/* Loading and Error States */
#symptoms-loading,
#symptoms-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

#symptoms-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color, #007bff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#symptoms-error {
    color: #dc3545;
}

#symptoms-error .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.btn-retry {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-retry:hover {
    background: var(--primary-color-dark, #0056b3);
}

/* ============================================
   SYMPTOMS STEP 5 - MODERN LAYOUT
   ============================================ */

/* Symptoms Search Filter */
.symptoms-search-wrapper {
    margin-bottom: 1rem;
    position: relative;
}

.symptoms-search {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.symptoms-search:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(4, 60, 137, 0.1);
}

.symptoms-search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.symptoms-search-count {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Symptoms Checkboxes Container */
#symptoms-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Checkbox Item - CSS Grid Layout */
.checkbox-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.checkbox-item:hover {
    background: #f8f9fa;
    border-color: var(--primary-color, #007bff);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.checkbox-item.checked {
    background: #e3f2fd;
    border-color: var(--primary-color, #007bff);
}

.checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--primary-color, #007bff);
}

/* Defect Content (Name + Description) */
.defect-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.defect-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    line-height: 1.4;
}

.defect-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.4;
}

.defect-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #94a3b8;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    margin-left: 0.5rem;
    cursor: help;
    vertical-align: middle;
}

.defect-tooltip:hover {
    background: var(--primary-color, #007bff);
}

/* Defect Price Badge */
.defect-price {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: var(--primary-color, #007bff);
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(4, 60, 137, 0.1);
}

.checkbox-item.checked .defect-price {
    background: linear-gradient(135deg, #043c89 0%, #0056b3 100%);
    color: white;
}

/* Empty State */
.symptoms-empty {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Price Summary */
.price-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-size: 1.1rem;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.price-summary span {
    color: var(--text-color);
    font-weight: 500;
}

.price-summary strong {
    color: var(--primary-color, #007bff);
    font-size: 1.4rem;
    font-weight: 700;
}

/* Symptoms Notes Textarea */
#symptoms_note {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease;
}

#symptoms_note:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(4, 60, 137, 0.1);
}

#symptoms_note::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Step Header for Symptoms */
.step-header {
    margin-bottom: 2rem;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.step-description {
    color: #6c757d;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .checkbox-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .checkbox-item input[type="checkbox"] {
        align-self: flex-start;
    }

    .defect-price {
        font-size: 1rem;
    }

    .price-summary {
        font-size: 1rem;
    }

    .price-summary strong {
        font-size: 1.2rem;
    }
}

/* ============================================
   INLINE BUTTON SPINNER (for verify button)
   ============================================ */

.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Success state for verify button */
.btn-success {
    background: #27d400 !important;
    border-color: #27d400 !important;
}

.btn-success:hover {
    background: #22b500 !important;
}

/* Disabled button state enhancement */
button:disabled {
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* ==============================================
   FLATPICKR CUSTOM STYLING
   ============================================== */

/* Flatpickr Input */
.flatpickr-input {
    cursor: pointer;
    background-color: white;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: all 0.2s ease;
}

.flatpickr-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 60, 137, 0.1);
}

.flatpickr-input[readonly] {
    background-color: white;
    cursor: pointer;
}

/* Available dates info */
.available-dates-info {
    margin-top: 0.5rem;
}

.available-dates-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

/* No dates available message */
#no-dates-available {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
}

#no-dates-available p {
    margin: 0;
    color: #856404;
}

#no-dates-available p:first-child {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#no-dates-available a {
    color: #043c89;
    font-weight: 600;
    text-decoration: none;
}

#no-dates-available a:hover {
    text-decoration: underline;
}

/* Flatpickr calendar customization */
.flatpickr-calendar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.flatpickr-day.selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.flatpickr-day.today {
    border-color: var(--primary-color);
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: #ccc !important;
    cursor: not-allowed !important;
}

/* Step 6: Autocomplete e validazione CF/P.IVA */
.input-spinner {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.validation-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: bold;
}

.validation-icon.valid {
    color: #28a745;
}

.validation-icon.invalid {
    color: #dc3545;
}

.autocomplete-message {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.autocomplete-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.autocomplete-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.autocomplete-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

/* Sezioni condizionali con transizione smooth */
#section-privato,
#section-piva,
#section-common {
    transition: opacity 0.3s ease, max-height 0.4s ease;
    overflow: hidden;
}

/* Migliora layout campi con icone */
.form-group input[id="codice_fiscale"],
.form-group input[id="partita_iva"] {
    padding-right: 70px;
}

/* Step 7: Device pre-fill info */
.device-prefill-info {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.device-prefill-info strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.device-prefill-info small {
    font-size: 13px;
    line-height: 1.5;
}

/* Campi disabled con stile grigio */
select:disabled,
input:disabled {
    background-color: #f0f0f0 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Step 9: Warranty pricing display */
.warranty-pricing {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.warranty-pricing .original-price {
    font-size: 16px;
    margin-bottom: 8px;
}

.warranty-pricing .warranty-coverage {
    display: flex;
    align-items: center;
    gap: 8px;
}

.warranty-pricing .warranty-info {
    font-style: italic;
    padding-left: 24px;
}

.warranty-pricing .final-price {
    border-top: 2px solid #ddd;
    padding-top: 16px;
}

.summary-section .total-price {
    color: #333;
}
