/**
 * Page Inscription - QuantisDigitale
 * Design moderne et professionnel
 */

/* ========================================
   RESET & BASE
   ======================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.inscription-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--hauteur-header-desktop) + var(--espace-12)) var(--espace-4) var(--espace-12);
    background: var(--couleur-fond-principal);
    position: relative;
}

/* Effet de fond */
.inscription-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 20%, rgba(59, 255, 122, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Conteneur */
.inscription-container {
    width: 100%;
    max-width: 520px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0 var(--espace-4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   CARTE PRINCIPALE
   ======================================== */

.inscription-card {
    background: var(--couleur-fond-secondaire);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-2xl);
    padding: var(--espace-8);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: visible;
    width: 100%;
    max-width: 100%;
}

[data-theme="clair"] .inscription-card {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

/* Barre accent top */
.inscription-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--couleur-accent), transparent);
}

/* ========================================
   EN-TÊTE
   ======================================== */

.card-header {
    text-align: center;
    margin-bottom: var(--espace-8);
}

.header-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--espace-4);
    background: rgba(59, 255, 122, 0.1);
    border: var(--bordure-1) solid rgba(59, 255, 122, 0.2);
    border-radius: var(--rayon-rond);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--texte-2xl);
    color: var(--couleur-accent);
}

.header-title {
    font-family: var(--polices-titres);
    font-size: var(--texte-2xl);
    font-weight: var(--poids-semibold);
    color: var(--couleur-texte);
    margin-bottom: var(--espace-2);
    line-height: 1.2;
}

.header-subtitle {
    font-size: var(--texte-sm);
    color: var(--couleur-texte-secondaire);
    line-height: 1.5;
}

/* ========================================
   FORMULAIRE
   ======================================== */

.inscription-form {
    display: flex;
    flex-direction: column;
    gap: var(--espace-5);
}

/* Champ de formulaire */
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--espace-2);
}

/* Label */
.field-label {
    display: flex;
    align-items: center;
    gap: var(--espace-2);
    font-size: var(--texte-sm);
    font-weight: var(--poids-medium);
    color: var(--couleur-texte);
}

.field-label i {
    font-size: var(--texte-base);
    color: var(--couleur-accent);
}

.label-optional {
    font-size: var(--texte-xs);
    font-weight: var(--poids-normal);
    color: var(--couleur-texte-tertiaire);
}

/* Input */
.field-input {
    width: 100%;
    padding: var(--espace-3);
    background: var(--couleur-fond-principale);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-lg);
    font-family: var(--polices-texte);
    font-size: var(--texte-base);
    color: var(--couleur-texte);
    transition: all 0.2s ease;
    outline: none;
}

.field-input::placeholder {
    color: var(--couleur-texte-tertiaire);
}

.field-input:hover {
    border-color: var(--couleur-bordure-hover);
}

.field-input:focus {
    border-color: var(--couleur-accent);
    box-shadow: 0 0 0 3px rgba(59, 255, 122, 0.1);
}

.field-input.error {
    border-color: var(--couleur-erreur);
}

.field-input.success {
    border-color: var(--couleur-succes);
}

/* Row 2 colonnes */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--espace-4);
    width: 100%;
}

/* Mot de passe */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper .field-input {
    width: 100%;
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 44px;
    background: transparent;
    border: none;
    color: var(--couleur-texte-secondaire);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 var(--rayon-lg) var(--rayon-lg) 0;
    transition: all 0.2s ease;
    z-index: 1;
}

.password-toggle:hover {
    color: var(--couleur-accent);
    background: rgba(59, 255, 122, 0.05);
}

/* Force du mot de passe */
.password-strength {
    margin-top: var(--espace-2);
}

.strength-bar {
    height: 3px;
    background: var(--couleur-fond-carte);
    border-radius: var(--rayon-pilule);
    overflow: hidden;
    margin-bottom: var(--espace-2);
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: var(--rayon-pilule);
}

.strength-fill.weak {
    width: 33%;
    background: var(--couleur-erreur);
}

.strength-fill.medium {
    width: 66%;
    background: var(--couleur-warning);
}

.strength-fill.strong {
    width: 100%;
    background: var(--couleur-succes);
}

.strength-text {
    font-size: var(--texte-xs);
    color: var(--couleur-texte-secondaire);
}

/* Checkbox custom */
.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: var(--espace-3);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-field input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: var(--bordure-2) solid var(--couleur-bordure);
    border-radius: var(--rayon-md);
    background: var(--couleur-fond-principale);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
    position: relative;
}

.checkbox-field input[type="checkbox"]:checked + .checkbox-box {
    background: var(--couleur-accent);
    border-color: var(--couleur-accent);
}

.checkbox-field input[type="checkbox"]:checked + .checkbox-box::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: var(--couleur-fond-principal);
    position: absolute;
}

.checkbox-field:hover .checkbox-box {
    border-color: var(--couleur-accent);
}

.checkbox-text {
    font-size: var(--texte-sm);
    color: var(--couleur-texte-secondaire);
    line-height: 1.5;
}

.checkbox-text a {
    color: var(--couleur-accent);
    text-decoration: none;
    font-weight: var(--poids-medium);
}

.checkbox-text a:hover {
    text-decoration: underline;
}

/* Erreur */
.field-error {
    font-size: var(--texte-xs);
    color: var(--couleur-erreur);
    display: none;
    margin-top: var(--espace-1);
}

.field-error.visible {
    display: block;
}

/* ========================================
   BOUTON SUBMIT
   ======================================== */

.submit-button {
    width: 100%;
    max-width: 100%;
    padding: var(--espace-3) var(--espace-5);
    margin-top: var(--espace-4);
    background: linear-gradient(135deg, var(--couleur-accent) 0%, #2DD96C 100%);
    border: none;
    border-radius: var(--rayon-lg);
    color: var(--couleur-fond-principal);
    font-family: var(--polices-texte);
    font-size: var(--texte-base);
    font-weight: var(--poids-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 255, 122, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-button:hover::before {
    width: 300px;
    height: 300px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 255, 122, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--espace-2);
    position: relative;
    z-index: 1;
}

.button-loader {
    display: none;
    position: relative;
    z-index: 1;
}

.submit-button.loading .button-content {
    display: none;
}

.submit-button.loading .button-loader {
    display: block;
}

/* ========================================
   FOOTER
   ======================================== */

.card-footer {
    text-align: center;
    margin-top: var(--espace-6);
    padding-top: var(--espace-6);
    border-top: var(--bordure-1) solid var(--couleur-bordure);
    font-size: var(--texte-sm);
    color: var(--couleur-texte-secondaire);
}

.footer-link {
    color: var(--couleur-accent);
    font-weight: var(--poids-semibold);
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-link:hover {
    text-decoration: underline;
}

/* ========================================
   MENTIONS LÉGALES
   ======================================== */

.legal-notice {
    text-align: center;
    margin-top: var(--espace-4);
    font-size: var(--texte-xs);
    color: var(--couleur-texte-tertiaire);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--espace-2);
}

.legal-notice i {
    color: var(--couleur-accent);
}

/* ========================================
   CUSTOM SELECT
   ======================================== */

.custom-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

.custom-select.active {
    z-index: 1001;
}

.select-trigger {
    width: 100%;
    padding: var(--espace-3);
    background: var(--couleur-fond-principale);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-lg);
    font-family: var(--polices-texte);
    font-size: var(--texte-base);
    color: var(--couleur-texte);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
}

.select-trigger:hover {
    border-color: var(--couleur-bordure-hover);
}

.select-trigger:focus,
.select-trigger.active {
    border-color: var(--couleur-accent);
    box-shadow: 0 0 0 3px rgba(59, 255, 122, 0.1);
}

.select-value {
    display: flex;
    align-items: center;
    gap: var(--espace-2);
    flex: 1;
}

.select-value i {
    color: var(--couleur-accent);
}

.select-arrow {
    font-size: var(--texte-sm);
    color: var(--couleur-texte-secondaire);
    transition: transform 0.2s ease;
}

.select-trigger.active .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + var(--espace-2));
    left: 0;
    right: 0;
    background: var(--couleur-fond-secondaire);
    border: var(--bordure-1) solid var(--couleur-bordure);
    border-radius: var(--rayon-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

[data-theme="clair"] .select-dropdown {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.select-dropdown.active {
    max-height: 240px;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-option {
    padding: var(--espace-3);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--couleur-texte);
    display: flex;
    align-items: center;
    gap: var(--espace-2);
}

.select-option:hover {
    background: rgba(59, 255, 122, 0.08);
}

[data-theme="clair"] .select-option:hover {
    background: rgba(40, 179, 94, 0.08);
}

.select-option.selected {
    background: rgba(59, 255, 122, 0.15);
    font-weight: var(--poids-semibold);
}

[data-theme="clair"] .select-option.selected {
    background: rgba(40, 179, 94, 0.15);
}

.select-option i {
    color: var(--couleur-accent);
    font-size: var(--texte-base);
}

.select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.select-dropdown::-webkit-scrollbar-thumb {
    background: rgba(59, 255, 122, 0.3);
    border-radius: var(--rayon-pilule);
}

.select-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 255, 122, 0.5);
}

/* ========================================
   ALERTS (REPRIS DE COMPOSANTS.CSS)
   ======================================== */

/* Alert de base */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--espace-3);
    padding: var(--espace-4);
    border-radius: var(--rayon-lg);
    border: var(--bordure-1) solid;
    font-family: var(--polices-texte);
    font-size: var(--texte-sm);
    line-height: var(--ligne-normale);
    position: relative;
    animation: alertSlideIn 0.3s var(--easing-smooth);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icône de l'alert */
.alert-icon {
    flex-shrink: 0;
    font-size: var(--texte-lg);
    margin-top: 2px;
}

/* Contenu de l'alert */
.alert-content {
    flex: 1;
}

.alert-titre {
    font-family: var(--polices-titres);
    font-weight: var(--poids-semibold);
    font-size: var(--texte-base);
    margin-bottom: var(--espace-1);
}

.alert-message {
    color: var(--couleur-texte-secondaire);
}

/* Bouton de fermeture */
.alert-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--espace-1);
    border-radius: var(--rayon-md);
    transition: var(--transition-normale);
    color: inherit;
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Variantes d'alerts */
.alert-succes {
    background: var(--couleur-succes-fond);
    border-color: var(--couleur-succes-bordure);
    color: var(--couleur-succes);
}

.alert-erreur {
    background: var(--couleur-erreur-fond);
    border-color: var(--couleur-erreur-bordure);
    color: var(--couleur-erreur);
}

.alert-warning {
    background: var(--couleur-warning-fond);
    border-color: var(--couleur-warning-bordure);
    color: var(--couleur-warning);
}

.alert-info {
    background: var(--couleur-info-fond);
    border-color: var(--couleur-info-bordure);
    color: var(--couleur-info);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .inscription-main {
        min-height: 100vh;
        padding: calc(var(--hauteur-header-mobile) + var(--espace-8)) var(--espace-4) var(--espace-8);
    }

    .inscription-card {
        padding: var(--espace-6);
    }

    .header-icon {
        width: 48px;
        height: 48px;
        font-size: var(--texte-xl);
    }

    .header-title {
        font-size: var(--texte-xl);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .inscription-card {
        padding: var(--espace-5);
    }

    .header-title {
        font-size: var(--texte-lg);
    }

    .field-input {
        font-size: var(--texte-sm);
        padding: var(--espace-2) var(--espace-3);
    }

    .password-wrapper .field-input {
        padding-right: 44px;
    }

    .submit-button {
        font-size: var(--texte-sm);
        padding: var(--espace-2) var(--espace-4);
    }
}

/* ========================================
   CONTENEUR ALERTS (POSITION FIXE)
   ======================================== */

.alerts-conteneur {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: var(--espace-3);
    max-width: 420px;
    pointer-events: none;
}

.alerts-conteneur > * {
    pointer-events: auto;
}

.alerts-conteneur.top-right {
    top: calc(var(--hauteur-header-desktop) + var(--espace-4));
    right: var(--espace-4);
}

.alerts-conteneur.top-left {
    top: calc(var(--hauteur-header-desktop) + var(--espace-4));
    left: var(--espace-4);
}

.alerts-conteneur.bottom-right {
    bottom: var(--espace-4);
    right: var(--espace-4);
}

.alerts-conteneur.bottom-left {
    bottom: var(--espace-4);
    left: var(--espace-4);
}

@keyframes alertSlideOut {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Responsive mobile */
@media (max-width: 768px) {
    .alerts-conteneur {
        max-width: calc(100vw - var(--espace-8));
    }

    .alerts-conteneur.top-right,
    .alerts-conteneur.top-left {
        top: calc(var(--hauteur-header-mobile) + var(--espace-3));
    }

    .alerts-conteneur.top-right {
        right: var(--espace-3);
    }

    .alerts-conteneur.top-left {
        left: var(--espace-3);
    }

    .alerts-conteneur.bottom-right {
        right: var(--espace-3);
        bottom: var(--espace-3);
    }

    .alerts-conteneur.bottom-left {
        left: var(--espace-3);
        bottom: var(--espace-3);
    }
}