/* Registration Form Styles - Coerente con template catalogo */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --dark: #1a202c;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-600: #718096;
    --gray-900: #1a202c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    min-height: 100vh;
    padding: 0; /* ✅ Rimuoviamo padding per permettere header full-width */
    color: var(--dark);
}

/* ========================================
   PAGE HEADER (Loghi)
   ======================================== */

.page-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    margin: 0; /* ✅ Full width */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vendor-logo {
    max-height: 40px;
    max-width: 120px;
    object-fit: contain;
}

.denebor-logo {
    height: 50px;
    max-width: 100px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .page-header {
        padding: 0.75rem 1rem;
        margin: 0 -1rem 1.5rem -1rem;
    }

    .vendor-logo {
        max-height: 35px;
        max-width: 100px;
    }

    .denebor-logo {
        height: 50px;
        max-width: 80px;
    }
}

.container {
    max-width: 600px;
    margin: 2rem auto; /* ✅ Margin top per separare da header */
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

h1 {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    text-align: center; /* ✅ Allineamento centrato */
}

.subtitle {
    color: var(--gray-600);
    text-align: center; /* ✅ Allineamento centrato come il titolo */
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0; /* ✅ Rimuoviamo padding per allineamento perfetto */
}

.registration-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--dark);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--danger);
}

.form-group input:read-only {
    background-color: var(--gray-50);
    cursor: not-allowed;
}

.form-group .error-message {
    color: var(--danger);
    font-size: 0.85rem;
    display: none;
}

.form-group .error-message.show {
    display: block;
}

.form-group .help-text {
    color: var(--gray-600);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Phone Input con Prefisso */
.phone-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.phone-prefix {
    flex: 0 0 140px;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.phone-prefix:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.phone-number {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.phone-number:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Address Validation Status */
.address-validation-status {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.address-validation-status.validating {
    background: var(--gray-100);
    color: var(--gray-600);
}

.address-validation-status.validated {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.address-validation-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.address-input {
    width: 100%;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 10px;
    border: 2px solid var(--gray-200);
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    font-weight: normal;
    cursor: pointer;
    line-height: 1.6;
    color: var(--dark);
}

.checkbox-group a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.checkbox-group a:hover {
    text-decoration: none;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    border: 2px solid var(--danger);
    color: #721c24;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Modal Privacy */
.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: var(--gray-600);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: var(--dark);
}

.privacy-content {
    margin-top: 2rem;
    line-height: 1.6;
}

.privacy-content iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0; /* ✅ Nessun padding per header full-width */
    }

    .container {
        padding: 1.5rem;
        margin: 1.5rem auto; /* ✅ Margin ridotto su mobile */
    }

    h1 {
        font-size: 1.5rem;
    }
    
    .page-header {
        padding: 0.75rem 1rem;
        margin: 0; /* ✅ Full width anche su mobile */
    }
    
    .subtitle {
        font-size: 0.9rem; /* ✅ Leggibilità migliore su mobile */
        padding: 0; /* ✅ Nessun padding per allineamento perfetto */
    }

    .phone-input-container {
        flex-direction: column;
    }

    .phone-prefix {
        flex: 1;
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
}
