/* FiftyFive Preventivi - Frontend Styles */

:root {
    --ff-primary: #333333;
    --ff-secondary: #4CAF50;
    --ff-accent: #FF5722;
    --ff-light: #f5f5f5;
    --ff-border: #e0e0e0;
    --ff-text: #444444;
    --ff-success: #4CAF50;
    --ff-error: #f44336;
    --ff-warning: #ff9800;
}

/* Wrapper principale */
.ff-preventivo-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--ff-text);
}

/* Progress Bar */
.ff-progress-bar {
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ff-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
}

.ff-step {
    flex: 1;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ff-step.active .ff-step-number {
    background: var(--ff-secondary);
    color: white;
    transform: scale(1.1);
}

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

.ff-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ff-light);
    color: var(--ff-text);
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.ff-step-label {
    display: block;
    font-size: 14px;
    color: var(--ff-text);
}

.ff-progress-line {
    height: 4px;
    background: var(--ff-border);
    border-radius: 2px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.ff-progress-fill {
    height: 100%;
    background: var(--ff-secondary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Step Content */
.ff-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ff-step-content.active {
    display: block;
}

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

.ff-step-content h2 {
    color: var(--ff-primary);
    margin-bottom: 10px;
    font-size: 28px;
}

.ff-step-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Service Categories */
.ff-service-category {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ff-service-category h3 {
    color: var(--ff-primary);
    margin-bottom: 20px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ff-service-category h3 .dashicons {
    color: var(--ff-secondary);
}

/* Services Grid */
.ff-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ff-service-card {
    border: 2px solid var(--ff-border);
    border-radius: 8px;
    padding: 20px;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ff-service-card:hover {
    border-color: var(--ff-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ff-service-card.selected {
    border-color: var(--ff-secondary);
    background: linear-gradient(135deg, #fff 0%, rgba(76,175,80,0.05) 100%);
}

.ff-service-card.selected::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--ff-secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.ff-service-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ff-primary);
    margin-bottom: 8px;
}

.ff-service-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.ff-service-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--ff-secondary);
    margin-bottom: 8px;
}

.ff-service-type {
    display: inline-block;
    padding: 4px 12px;
    background: var(--ff-light);
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.ff-service-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--ff-border);
}

.ff-quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--ff-border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ff-quantity-btn:hover {
    background: var(--ff-light);
}

.ff-quantity-value {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
}

/* Cart Summary */
.ff-cart-summary {
    position: sticky;
    top: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 30px;
}

.ff-cart-summary h4 {
    color: var(--ff-primary);
    margin-bottom: 15px;
    font-size: 18px;
}

.ff-cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.ff-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--ff-border);
}

.ff-cart-item-name {
    flex: 1;
    font-size: 14px;
}

.ff-cart-item-price {
    font-weight: bold;
    color: var(--ff-secondary);
}

.ff-cart-item-remove {
    color: var(--ff-error);
    cursor: pointer;
    margin-left: 10px;
}

.ff-empty-cart {
    text-align: center;
    color: #999;
    padding: 20px 0;
}

.ff-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    padding-top: 15px;
    border-top: 2px solid var(--ff-primary);
}

.ff-total-amount {
    font-weight: bold;
    color: var(--ff-secondary);
    font-size: 24px;
}

/* Forms */
.ff-client-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ff-form-group {
    margin-bottom: 25px;
}

.ff-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--ff-primary);
}

.ff-form-group input,
.ff-form-group textarea,
.ff-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--ff-border);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.ff-form-group input:focus,
.ff-form-group textarea:focus,
.ff-form-group select:focus {
    outline: none;
    border-color: var(--ff-secondary);
}

.ff-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.ff-checkbox input {
    width: auto;
    margin-right: 10px;
    margin-top: 4px;
}

.ff-coupon-input {
    display: flex;
    gap: 10px;
}

.ff-coupon-input input {
    flex: 1;
}

.ff-coupon-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.ff-coupon-message.success {
    display: block;
    background: #e8f5e9;
    color: var(--ff-success);
}

.ff-coupon-message.error {
    display: block;
    background: #ffebee;
    color: var(--ff-error);
}

/* Buttons */
.ff-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.ff-btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76,175,80,0.3);
}

.ff-btn-secondary {
    background: var(--ff-light);
    color: var(--ff-primary);
}

.ff-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.ff-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ff-btn-action {
    flex: 1;
    flex-direction: column;
    padding: 20px;
    background: white;
    border: 2px solid var(--ff-border);
    color: var(--ff-primary);
}

.ff-btn-action:hover:not(:disabled) {
    border-color: var(--ff-secondary);
    background: var(--ff-light);
}

.ff-btn-action .dashicons {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Navigation */
.ff-step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--ff-border);
}

/* Summary */
.ff-summary-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ff-summary-section h3 {
    color: var(--ff-primary);
    margin-bottom: 20px;
}

.ff-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.ff-summary-table th {
    background: var(--ff-light);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.ff-summary-table td {
    padding: 12px;
    border-bottom: 1px solid var(--ff-border);
}

.ff-summary-table tfoot tr {
    font-weight: bold;
}

.ff-summary-table .ff-total td {
    font-size: 18px;
    padding-top: 15px;
}

/* Actions Grid */
.ff-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Success Message */
.ff-success-message {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ff-success-message .dashicons-yes-alt {
    font-size: 72px;
    color: var(--ff-success);
    margin-bottom: 20px;
}

.ff-quote-number {
    background: var(--ff-light);
    padding: 15px 25px;
    border-radius: 8px;
    margin: 30px 0;
    font-size: 18px;
}

.ff-final-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.ff-contact-info {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--ff-border);
}

.ff-contact-methods {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
}

.ff-contact-method {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ff-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.ff-contact-method:hover {
    color: var(--ff-secondary);
}

/* Loading Overlay */
.ff-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.ff-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.ff-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.ff-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.ff-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.ff-modal-close:hover {
    color: var(--ff-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .ff-services-grid {
        grid-template-columns: 1fr;
    }
    
    .ff-progress-steps {
        flex-direction: column;
        gap: 20px;
    }
    
    .ff-step-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .ff-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ff-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .ff-contact-methods {
        flex-direction: column;
        gap: 15px;
    }
    
    .ff-summary-table {
        font-size: 14px;
    }
    
    .ff-summary-table th,
    .ff-summary-table td {
        padding: 8px 5px;
    }
}

/* Print Styles */
@media print {
    .ff-step-navigation,
    .ff-progress-bar,
    .ff-btn {
        display: none !important;
    }
    
    .ff-step-content {
        display: block !important;
        page-break-inside: avoid;
    }
}
