/**
 * Multi-Step Registration Form - Styles
 * Version avec autocomplétion adresse et indicatifs téléphoniques
 */

/* ====================================
   Variables CSS
   ==================================== */
:root {
    --msr-primary: #2563eb;
    --msr-primary-hover: #029BD6;
    --msr-secondary: #64748b;
    --msr-success: #22c55e;
    --msr-error: #ef4444;
    --msr-warning: #f59e0b;
    --msr-border: #e2e8f0;
    --msr-bg: #f8fafc;
    --msr-text: #1e293b;
    --msr-text-light: #64748b;
    --msr-radius: 8px;
    --msr-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --msr-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ====================================
   Container principal
   ==================================== */
.msr-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--msr-text);
}

/* ====================================
   Barre de progression
   ==================================== */
.msr-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--msr-border);
    border-radius: 3px;
    margin-bottom: 30px;
    overflow: hidden;
}

.msr-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--msr-primary), var(--msr-success));
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ====================================
   Étapes
   ==================================== */
.msr-step {
    animation: fadeIn 0.3s ease;
}

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

.msr-step h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--msr-text);
}

.msr-step h3 {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--msr-text-light);
    margin-bottom: 25px;
}

/* ====================================
   Formulaire
   ==================================== */
   [type=button]:focus, [type=button]:hover, [type=submit]:focus, [type=submit]:hover, button:focus, button:hover {
    background-color: #32BFF1 !important;
    color: #fff !important;
    text-decoration: none;
}
#eu-yes-btn, #eu-no-btn {
    text-align: left !important;
    color: #002C3B !important;
}
button.msr-btn {
    color: #002C3B;
}
.msr-btn-back{
    border-color: #002C3B;
}
.msr-btn-next{
    background-color: #32BFF1;
}
.msr-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.msr-form label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--msr-text);
    margin-bottom: 7px;
}

.msr-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--msr-border);
    border-radius: var(--msr-radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
}

.msr-input:focus {
    outline: none;
    border-color: var(--msr-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.msr-input:read-only {
    background: var(--msr-bg);
    color: var(--msr-text-light);
}

.msr-input::placeholder {
    color: #94a3b8;
}

/* ====================================
   Champ téléphone avec indicatif
   ==================================== */
.msr-phone-input-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.msr-country-code-select {
    flex: 0 0 120px;
    min-width: 120px;
    padding: 14px 10px;
    font-size: 0.95rem;
    cursor: pointer;
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.msr-country-code-select:focus {
    outline: none;
    border-color: var(--msr-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.msr-phone-number-input {
    flex: 1;
}

/* ====================================
   Autocomplétion adresse
   ==================================== */
.msr-address-autocomplete-container {
    position: relative;
    width: 100%;
}

.msr-address-search {
    padding-right: 40px;
}

.msr-address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--msr-primary);
    border-top: none;
    border-radius: 0 0 var(--msr-radius) var(--msr-radius);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--msr-shadow-lg);
    display: none;
}

.msr-address-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--msr-border);
    font-size: 0.95rem;
    transition: background 0.15s ease;
}

.msr-address-suggestion-item:last-child {
    border-bottom: none;
}

.msr-address-suggestion-item:hover {
    background: var(--msr-bg);
}

.msr-address-suggestion-item:active {
    background: #e2e8f0;
}

/* ====================================
   Boutons de choix (EU/Non-EU)
   ==================================== */
.msr-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.msr-btn-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 20px;
    border: 2px solid var(--msr-border);
    border-radius: var(--msr-radius);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

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

.msr-btn-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.msr-btn-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--msr-text);
}

.msr-btn-subtext {
    font-size: 0.85rem;
    color: var(--msr-text-light);
    margin-top: 5px;
}

/* ====================================
   Boutons
   ==================================== */
.msr-button-row {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.msr-button-center {
    justify-content: center;
}

.msr-btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--msr-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.msr-btn-primary {
    background: linear-gradient(135deg, var(--msr-primary), var(--msr-primary-hover));
    color: white !important;
    flex: 1;
}

button.msr-password-toggle {
    border: none;
}
.msr-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.msr-btn-secondary {
    background: white;
    color: var(--msr-secondary);
    border: 2px solid var(--msr-border);
}

.msr-btn-secondary:hover {
    background: var(--msr-bg);
    border-color: var(--msr-secondary);
}

.msr-btn-search {
    padding: 14px 18px;
    background: var(--msr-primary);
    color: white;
    border-radius: var(--msr-radius);
}

.msr-btn-search:hover {
    background: var(--msr-primary-hover);
}

/* ====================================
   SIREN Input
   ==================================== */
.msr-siren-input-container {
    display: flex;
    gap: 10px;
}

.msr-siren-input {
    flex: 1;
    font-size: 1.25rem;
    letter-spacing: 2px;
    text-align: center;
}

/* ====================================
   Texte d'aide
   ==================================== */
.msr-help-text {
    font-size: 0.85rem;
    color: var(--msr-text-light);
    margin-top: -10px;
}

.msr-required-note {
    font-size: 0.85rem;
    color: var(--msr-text-light);
    font-style: italic;
    margin-bottom: 20px;
}

/* ====================================
   Force du mot de passe
   ==================================== */
.msr-password-strength {
    height: 6px;
    background: var(--msr-border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: -10px;
}

.msr-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.msr-strength-bar.weak { background: var(--msr-error); }
.msr-strength-bar.medium { background: var(--msr-warning); }
.msr-strength-bar.strong { background: #84cc16; }
.msr-strength-bar.very-strong { background: var(--msr-success); }

.msr-password-hint {
    font-size: 0.8rem;
    color: var(--msr-text-light);
    margin-top: -5px;
}

/* ====================================
   Préférences et termes
   ==================================== */
.msr-preferences {
    background: var(--msr-bg);
    padding: 20px;
    border-radius: var(--msr-radius);
    margin-top: 10px;
}

.msr-preferences h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--msr-text);
}

.msr-checkbox-label {
    display: flex;
	align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--msr-text);
}

.msr-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--msr-primary);
}

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

.msr-terms {
    margin-top: 15px;
}

/* ====================================
   Confirmation
   ==================================== */
.msr-confirmation {
    text-align: center;
    padding: 30px 0;
}

.msr-confirmation-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--msr-success), #16a34a);
    color: white;
    font-size: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.msr-summary-content {
    text-align: left;
    background: var(--msr-bg);
    padding: 25px;
    border-radius: var(--msr-radius);
    margin: 25px 0;
}

.msr-summary-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--msr-border);
}

.msr-summary-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.msr-summary-section h4 {
    color: var(--msr-primary);
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.msr-summary-section p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: var(--msr-text);
}

.msr-summary-section strong {
    color: var(--msr-text-light);
    font-weight: 500;
}

/* ====================================
   Loader
   ==================================== */
.msr-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.msr-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--msr-border);
    border-top-color: var(--msr-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.msr-loader p {
    margin-top: 15px;
    color: var(--msr-text-light);
    font-size: 0.95rem;
}

/* ====================================
   Messages d'erreur
   ==================================== */
.msr-error-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: 500px;
    width: 90%;
}

.msr-error-message {
    background: var(--msr-error);
    color: white;
    padding: 16px 24px;
    border-radius: var(--msr-radius);
    font-size: 0.95rem;
    box-shadow: var(--msr-shadow-lg);
    text-align: center;
}

/* ====================================
   Utilisateur déjà connecté
   ==================================== */
.msr-already-logged-in {
    text-align: center;
    padding: 40px 20px;
}

.msr-already-logged-in p {
    font-size: 1.1rem;
    color: var(--msr-text-light);
    margin-bottom: 20px;
}

/* ====================================
   Responsive
   ==================================== */
@media (max-width: 640px) {
    .msr-container {
        padding: 20px 15px;
    }
    
    .msr-step h2 {
        font-size: 1.4rem;
    }
    
    .msr-step h3 {
        font-size: 1rem;
    }
    
    .msr-button-row {
        flex-direction: column;
    }
    
    .msr-btn-secondary {
        order: 2;
    }
    
    .msr-btn-primary {
        order: 1;
    }
    
    .msr-phone-input-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .msr-country-code-select {
        flex: none;
        width: 100%;
    }
    
    .msr-siren-input-container {
        flex-direction: column;
    }
    
    .msr-btn-search {
        width: 100%;
    }
}

/* ====================================
   Select dropdown styling
   ==================================== */
select.msr-input {
    cursor: pointer;
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* ====================================
   Affiliate Field Styles
   ==================================== */
.msr-affiliate-field {
    background: var(--msr-bg);
    border: 2px dashed var(--msr-border);
    border-radius: var(--msr-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.msr-affiliate-field label {
    font-weight: 600;
    color: var(--msr-text);
    margin-bottom: 10px;
    display: block;
}

.msr-affiliate-detected {
    color: var(--msr-success);
    font-size: 0.85rem;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.msr-affiliate-validation {
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
}

.msr-affiliate-validation.valid {
    color: var(--msr-success);
}

.msr-affiliate-validation.invalid {
    color: var(--msr-error);
}

/* ====================================
   Password Toggle
   ==================================== */
.msr-password-container {
    position: relative;
    margin-bottom: 15px;
}

.msr-password-container .msr-input-password {
    padding-right: 50px;
    margin-bottom: 0;
}

.msr-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--msr-text-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msr-password-toggle:hover {
    color: var(--msr-primary);
    background: none !important;
}

.msr-password-toggle:focus {
    outline: none;
    background: none !important;
}

.msr-password-toggle .msr-eye-icon {
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.msr-password-toggle:hover .msr-eye-icon {
    opacity: 1;
}

.msr-password-toggle.active .msr-eye-icon {
    opacity: 1;
}

/* Ajustement pour le champ avec l'icône */
.msr-password-container .msr-input {
    width: 100%;
}

/* ====================================
   Login Link
   ==================================== */
.msr-login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--msr-border);
}

.msr-login-link p {
    color: var(--msr-text-light);
    font-size: 0.95rem;
    margin: 0;
}

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

.msr-login-link a:hover {
    color: var(--msr-primary-hover);
    text-decoration: underline;
}
