﻿/* ==========================================================================
   REGISTER VIEW STYLES - ULTRA RESPONSIVE OPTIMISÉ
   ========================================================================== */

/* Variables CSS spécifiques à la page d'inscription */
:root {
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffaa00;
    --info-bg: #d9edf7;
    --info-border: #bee5eb;
    --info-text: #0c5460;
    --weak-color: #ff4444;
    --medium-color: #ffaa00;
    --strong-color: #00aa00;
    --light-bg: #f8f9fa;
    --medium-bg: #e0e0e0;
    --border-light: #dee2e6;
    --text-muted: #6c757d;
    --text-dark: #495057;
    --disabled-bg: #6c757d;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* ==========================================================================
   PASSWORD INPUT CONTAINER & TOGGLE
   ========================================================================== */

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    z-index: 10;
    background: white;
    padding: 2px;
    border-radius: 3px;
    transition: background var(--transition-fast);
}

    .password-toggle:hover {
        background: #f0f0f0;
    }

.eye-icon {
    font-size: 16px;
    color: #666;
    transition: color var(--transition-medium);
    pointer-events: none;
}

.password-toggle:hover .eye-icon {
    color: #5a6c7d;
}

.password-toggle.showing .eye-icon {
    opacity: 0.7;
}

/* ==========================================================================
   ALERT STYLES
   ========================================================================== */

.alert {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.alert-info {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--info-text);
}

/* ==========================================================================
   PASSWORD STRENGTH INDICATOR
   ========================================================================== */

.password-strength-container {
    margin-top: 8px;
}

.password-strength-meter {
    width: 100%;
    height: 6px;
    background-color: var(--medium-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all var(--transition-medium);
    border-radius: 3px;
}

.password-strength-text {
    font-size: 12px;
    font-weight: 500;
    display: block;
}

.strength-weak {
    background-color: var(--weak-color);
}

.strength-medium {
    background-color: var(--medium-color);
}

.strength-strong {
    background-color: var(--strong-color);
}

.text-weak {
    color: var(--weak-color);
}

.text-medium {
    color: var(--medium-color);
}

.text-strong {
    color: var(--strong-color);
}

/* ==========================================================================
   PASSWORD REQUIREMENTS
   ========================================================================== */

.password-requirements {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 4px;
    border-left: 4px solid var(--border-light);
}

.requirements-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.requirements-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.requirement {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-muted);
    transition: color var(--transition-medium);
}

.req-icon {
    margin-right: 8px;
    font-size: 12px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.requirement.valid {
    color: var(--success-color);
}

    .requirement.valid .req-icon {
        color: var(--success-color);
    }

/* ==========================================================================
   PASSWORD MATCH FEEDBACK
   ========================================================================== */

.password-match-feedback {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 500;
    min-height: 18px;
}

.match-success {
    color: var(--success-color);
}

.match-error {
    color: var(--danger-color);
}

/* ==========================================================================
   FORM VALIDATION STATES
   ========================================================================== */

.form-control.invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.btn-account:disabled {
    background-color: var(--disabled-bg);
    border-color: var(--disabled-bg);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ========================================================================== */

/* Très petits smartphones - 280px à 320px */
@media (max-width: 320px) {
    .password-toggle {
        right: 3px;
        padding: 1px;
    }

    .eye-icon {
        font-size: 14px;
    }

    .password-strength-meter {
        height: 5px;
    }

    .password-strength-text {
        font-size: 10px;
    }

    .password-requirements {
        margin-top: 8px;
        padding: 8px;
    }

    .requirements-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .requirement {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .req-icon {
        font-size: 10px;
        width: 14px;
        margin-right: 6px;
    }

    .password-match-feedback {
        font-size: 11px;
        margin-top: 4px;
    }

    .alert {
        padding: 8px;
        margin: 8px 0;
        font-size: 12px;
    }
}

/* Petits smartphones - 321px à 374px */
@media (min-width: 321px) and (max-width: 374px) {
    .password-toggle {
        right: 3px;
        padding: 1px;
    }

    .eye-icon {
        font-size: 14px;
    }

    .password-strength-meter {
        height: 5px;
    }

    .password-strength-text {
        font-size: 10px;
    }

    .password-requirements {
        margin-top: 8px;
        padding: 8px;
    }

    .requirements-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .requirement {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .req-icon {
        font-size: 10px;
        width: 14px;
        margin-right: 6px;
    }

    .password-match-feedback {
        font-size: 11px;
        margin-top: 4px;
    }

    .alert {
        padding: 8px;
        margin: 8px 0;
        font-size: 12px;
    }
}

/* Smartphones modernes standards - 375px à 413px */
@media (min-width: 375px) and (max-width: 413px) {
    .password-toggle {
        right: 4px;
        padding: 2px;
    }

    .eye-icon {
        font-size: 15px;
    }

    .password-strength-meter {
        height: 5px;
    }

    .password-strength-text {
        font-size: 11px;
    }

    .password-requirements {
        margin-top: 9px;
        padding: 9px;
    }

    .requirements-title {
        font-size: 12px;
        margin-bottom: 7px;
    }

    .requirement {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .req-icon {
        font-size: 11px;
        width: 15px;
        margin-right: 7px;
    }

    .password-match-feedback {
        font-size: 11px;
        margin-top: 4px;
    }

    .alert {
        padding: 9px;
        margin: 9px 0;
        font-size: 12px;
    }
}

/* Smartphones moyens - 414px à 427px */
@media (min-width: 414px) and (max-width: 427px) {
    .password-toggle {
        right: 4px;
        padding: 2px;
    }

    .eye-icon {
        font-size: 15px;
    }

    .password-strength-meter {
        height: 6px;
    }

    .password-strength-text {
        font-size: 11px;
    }

    .password-requirements {
        margin-top: 9px;
        padding: 9px;
    }

    .requirements-title {
        font-size: 13px;
        margin-bottom: 7px;
    }

    .requirement {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .req-icon {
        font-size: 11px;
        width: 15px;
        margin-right: 7px;
    }

    .password-match-feedback {
        font-size: 12px;
        margin-top: 4px;
    }

    .alert {
        padding: 9px;
        margin: 9px 0;
        font-size: 13px;
    }
}

/* Grands smartphones - 428px à 599px */
@media (min-width: 428px) and (max-width: 599px) {
    .password-toggle {
        right: 5px;
        padding: 2px;
    }

    .eye-icon {
        font-size: 16px;
    }

    .password-strength-meter {
        height: 6px;
    }

    .password-strength-text {
        font-size: 12px;
    }

    .password-requirements {
        margin-top: 10px;
        padding: 10px;
    }

    .requirements-title {
        font-size: 13px;
        margin-bottom: 7px;
    }

    .requirement {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .req-icon {
        font-size: 11px;
        width: 15px;
        margin-right: 7px;
    }

    .password-match-feedback {
        font-size: 12px;
        margin-top: 5px;
    }

    .alert {
        padding: 10px;
        margin: 10px 0;
        font-size: 13px;
    }
}

/* Smartphones en mode paysage - 568px à 667px landscape */
@media (min-width: 568px) and (max-width: 667px) and (orientation: landscape) {
    .password-requirements {
        margin-top: 8px;
        padding: 8px;
    }

    .requirements-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .requirement {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .req-icon {
        font-size: 10px;
        width: 14px;
        margin-right: 6px;
    }

    .password-strength-meter {
        height: 5px;
    }

    .password-strength-text {
        font-size: 11px;
    }

    .alert {
        padding: 8px;
        margin: 8px 0;
        font-size: 12px;
    }
}

/* Petites tablettes - 600px à 767px */
@media (min-width: 600px) and (max-width: 767px) {
    .password-toggle {
        right: 5px;
        padding: 2px;
    }

    .eye-icon {
        font-size: 16px;
    }

    .password-strength-meter {
        height: 6px;
    }

    .password-strength-text {
        font-size: 12px;
    }

    .password-requirements {
        margin-top: 10px;
        padding: 10px;
    }

    .requirements-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .requirement {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .req-icon {
        font-size: 12px;
        width: 16px;
        margin-right: 8px;
    }

    .password-match-feedback {
        font-size: 13px;
        margin-top: 5px;
    }

    .alert {
        padding: 10px;
        margin: 10px 0;
        font-size: 14px;
    }
}

/* Tablettes standard - 768px à 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .password-toggle {
        right: 6px;
        padding: 3px;
    }

    .eye-icon {
        font-size: 17px;
    }

    .password-strength-meter {
        height: 7px;
    }

    .password-strength-text {
        font-size: 13px;
    }

    .password-requirements {
        margin-top: 11px;
        padding: 11px;
    }

    .requirements-title {
        font-size: 14px;
        margin-bottom: 9px;
    }

    .requirement {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .req-icon {
        font-size: 12px;
        width: 17px;
        margin-right: 9px;
    }

    .password-match-feedback {
        font-size: 13px;
        margin-top: 6px;
    }

    .alert {
        padding: 11px;
        margin: 11px 0;
        font-size: 14px;
    }
}

/* Grandes tablettes et petits laptops - 1024px à 1279px */
@media (min-width: 1024px) and (max-width: 1279px) {
    .password-toggle {
        right: 6px;
        padding: 3px;
    }

    .eye-icon {
        font-size: 17px;
    }

    .password-strength-meter {
        height: 7px;
    }

    .password-strength-text {
        font-size: 13px;
    }

    .password-requirements {
        margin-top: 11px;
        padding: 11px;
    }

    .requirements-title {
        font-size: 15px;
        margin-bottom: 9px;
    }

    .requirement {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .req-icon {
        font-size: 13px;
        width: 17px;
        margin-right: 9px;
    }

    .password-match-feedback {
        font-size: 14px;
        margin-top: 6px;
    }

    .alert {
        padding: 11px;
        margin: 11px 0;
        font-size: 14px;
    }
}

/* Desktop standard / Laptop - 1280px à 1439px */
@media (min-width: 1280px) and (max-width: 1439px) {
    .password-toggle {
        right: 7px;
        padding: 3px;
    }

    .eye-icon {
        font-size: 18px;
    }

    .password-strength-meter {
        height: 7px;
    }

    .password-strength-text {
        font-size: 13px;
    }

    .password-requirements {
        margin-top: 12px;
        padding: 12px;
    }

    .requirements-title {
        font-size: 15px;
        margin-bottom: 9px;
    }

    .requirement {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .req-icon {
        font-size: 13px;
        width: 18px;
        margin-right: 9px;
    }

    .password-match-feedback {
        font-size: 14px;
        margin-top: 6px;
    }

    .alert {
        padding: 12px;
        margin: 12px 0;
        font-size: 15px;
    }
}

/* Desktop Full HD - 1440px à 1919px */
@media (min-width: 1440px) and (max-width: 1919px) {
    .password-toggle {
        right: 7px;
        padding: 3px;
    }

    .eye-icon {
        font-size: 18px;
    }

    .password-strength-meter {
        height: 8px;
    }

    .password-strength-text {
        font-size: 14px;
    }

    .password-requirements {
        margin-top: 12px;
        padding: 12px;
    }

    .requirements-title {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .requirement {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .req-icon {
        font-size: 13px;
        width: 18px;
        margin-right: 10px;
    }

    .password-match-feedback {
        font-size: 14px;
        margin-top: 6px;
    }

    .alert {
        padding: 12px;
        margin: 12px 0;
        font-size: 15px;
    }
}

/* Grands écrans (2K, 4K, ultra-wide) - 1920px+ */
@media (min-width: 1920px) {
    .password-toggle {
        right: 8px;
        padding: 4px;
    }

    .eye-icon {
        font-size: 19px;
    }

    .password-strength-meter {
        height: 8px;
    }

    .password-strength-text {
        font-size: 15px;
    }

    .password-requirements {
        margin-top: 13px;
        padding: 13px;
    }

    .requirements-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .requirement {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .req-icon {
        font-size: 14px;
        width: 19px;
        margin-right: 10px;
    }

    .password-match-feedback {
        font-size: 15px;
        margin-top: 7px;
    }

    .alert {
        padding: 13px;
        margin: 13px 0;
        font-size: 16px;
    }
}

/* Mode portrait spécifique pour tablettes */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .password-requirements {
        margin-top: 11px;
        padding: 11px;
    }

    .requirements-title {
        font-size: 15px;
    }

    .requirement {
        font-size: 14px;
    }

    .alert {
        padding: 11px;
    }
}

/* Mode paysage pour tablettes */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .password-requirements {
        margin-top: 9px;
        padding: 9px;
    }

    .requirements-title {
        font-size: 13px;
        margin-bottom: 7px;
    }

    .requirement {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .req-icon {
        font-size: 11px;
        width: 15px;
        margin-right: 7px;
    }

    .password-strength-meter {
        height: 6px;
    }

    .alert {
        padding: 9px;
        margin: 9px 0;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Focus visible pour la navigation au clavier */
.password-toggle:focus-visible {
    outline: 2px solid var(--success-color);
    outline-offset: 2px;
}

.btn-account:disabled:focus-visible {
    outline: 2px solid var(--disabled-bg);
    outline-offset: 2px;
}

/* Amélioration du contraste pour l'accessibilité */
@media (prefers-contrast: high) {
    .password-requirements {
        border-left-width: 5px;
        border-left-color: #000;
    }

    .requirements-title {
        color: #000;
    }

    .requirement {
        color: #000;
    }

        .requirement.valid {
            color: #006400;
        }

    .text-weak {
        color: #cc0000;
    }

    .text-medium {
        color: #cc8800;
    }

    .text-strong {
        color: #006400;
    }

    .alert-info {
        border-width: 2px;
        font-weight: 500;
    }
}

/* Réduction des animations pour ceux qui préfèrent */
@media (prefers-reduced-motion: reduce) {
    .password-toggle,
    .eye-icon,
    .password-strength-fill,
    .requirement {
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   TOUCH OPTIMIZATIONS
   ========================================================================== */

/* Amélioration de la zone de clic sur mobile */
@media (hover: none) and (pointer: coarse) {
    .password-toggle {
        padding: 6px;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .eye-icon {
        font-size: 18px;
    }

    .requirement {
        padding: 4px 0;
        min-height: 32px;
    }
}

/* ==========================================================================
   FIX POUR PROBLÈMES COMMUNS
   ========================================================================== */

/* Fix pour Safari iOS - empêcher le zoom sur focus */
@supports (-webkit-touch-callout: none) {
    .password-input-container input.form-control {
        font-size: 16px !important;
    }
}

/* Fix pour Edge - amélioration du rendu */
@supports (-ms-ime-align: auto) {
    .requirement {
        align-items: flex-start;
    }

    .req-icon {
        margin-top: 2px;
    }
}

/* Fix pour Firefox - amélioration de l'affichage des emojis */
@-moz-document url-prefix() {
    .eye-icon,
    .req-icon {
        line-height: 1;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .password-toggle,
    .password-strength-container,
    .password-requirements,
    .password-match-feedback,
    .alert {
        display: none !important;
    }

    .password-input-container input {
        border: 1px solid #000;
    }
}

/* ==========================================================================
   ANIMATIONS (Optionnelles)
   ========================================================================== */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.form-control.invalid {
    animation: shake 0.4s ease-in-out;
}

/* Animation pour l'apparition des critères validés */
@keyframes checkmark {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.requirement.valid .req-icon {
    animation: checkmark 0.3s ease-out;
}

/* ==========================================================================
   DARK MODE SUPPORT (Optionnel)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Ajoutez ici les styles dark mode si nécessaire */
    /* Exemple:
    .password-toggle {
        background: #2d2d2d;
    }
    
    .password-toggle:hover {
        background: #3d3d3d;
    }
    
    .eye-icon {
        color: #ccc;
    }
    
    .password-requirements {
        background-color: #2d2d2d;
        border-left-color: #444;
    }
    
    .requirements-title,
    .requirement {
        color: #ccc;
    }
    */
}
