/* ============================================
   STYLES PAGES AUTHENTIFICATION
   (login, register, password reset)
   ============================================ */

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    padding: 2rem 0;
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--azur-blue);
    margin-bottom: 10px;
    font-size: 2rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember-me-group {
    margin-bottom: 0 !important;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.remember-me-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.remember-me-label span {
    user-select: none;
}

.forgot-password-link {
    color: var(--azur-blue);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: var(--deep-blue);
    text-decoration: underline;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-navy);
    font-weight: 500;
}

.login-form .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    outline: none;
    border-color: var(--azur-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.login-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.register-link {
    color: white;
    background: var(--gold);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.register-link:hover {
    background: var(--dark-navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-link {
    color: var(--azur-blue);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* ============================================
   REGISTER PAGE
   ============================================ */

.register-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    padding: 2rem 0;
}

.register-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.register-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2rem;
}

.register-form .form-group {
    margin-bottom: 1.5rem;
}

.register-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-navy);
    font-weight: 500;
}

.register-form .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.register-form .form-control:focus {
    outline: none;
    border-color: var(--azur-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.register-links {
    margin-top: 1.5rem;
    text-align: center;
}

.register-links a {
    color: var(--azur-blue);
    text-decoration: none;
}

.register-links a:hover {
    text-decoration: underline;
}

/* ============================================
   PASSWORD RESET PAGE
   ============================================ */

.password-reset-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    padding: 2rem 0;
}

.password-reset-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.password-reset-header {
    text-align: center;
    margin-bottom: 2rem;
}

.password-reset-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.password-reset-header p {
    color: #6c757d;
    font-size: 0.95rem;
}

.password-reset-form .form-group {
    margin-bottom: 1.5rem;
}

.password-reset-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-navy);
    font-weight: 500;
}

.password-reset-form .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.password-reset-form .form-control:focus {
    outline: none;
    border-color: var(--azur-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.password-reset-links {
    margin-top: 1.5rem;
    text-align: center;
}

.password-reset-links a {
    color: var(--azur-blue);
    text-decoration: none;
}

.password-reset-links a:hover {
    text-decoration: underline;
}

/* ============================================
   PASSWORD RESET FORM (request & reset)
   ============================================ */

.reset-container {
    max-width: 500px;
    margin: 60px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.reset-header {
    text-align: center;
    margin-bottom: 30px;
}

.reset-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.reset-header p {
    color: #6c757d;
}

.reset-container .form-group {
    margin-bottom: 20px;
}

.reset-container .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.reset-container .form-control:focus {
    border-color: #667eea;
    outline: none;
}

.reset-container .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.reset-container .btn-primary:hover {
    transform: translateY(-2px);
}

.reset-container .password-requirements {
    font-size: 14px;
    color: #6c757d;
    margin-top: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.reset-container .password-requirements ul {
    margin: 5px 0;
    padding-left: 20px;
}

.reset-container .back-link {
    text-align: center;
    margin-top: 20px;
}

.reset-container .back-link a {
    color: #667eea;
    text-decoration: none;
}

.reset-container .back-link a:hover {
    text-decoration: underline;
}

/* ============================================
   COMMON AUTH STYLES
   ============================================ */

.login-page .alert,
.register-page .alert,
.password-reset-page .alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.login-page .alert-danger,
.register-page .alert-danger,
.password-reset-page .alert-danger {
    background: #fee;
    border-color: #dc3545;
    color: #721c24;
}

.login-page .alert-success,
.register-page .alert-success,
.password-reset-page .alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.login-page .btn-block,
.register-page .btn-block,
.password-reset-page .btn-block {
    width: 100%;
}

.login-page .btn,
.register-page .btn,
.password-reset-page .btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.login-page .btn-primary,
.register-page .btn-primary,
.password-reset-page .btn-primary {
    background: var(--azur-blue);
    color: white;
}

.login-page .btn-primary:hover,
.register-page .btn-primary:hover,
.password-reset-page .btn-primary:hover {
    background: var(--deep-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ============================================
   REGISTRATION PAGE (Full form)
   ============================================ */

.registration-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.registration-header {
    text-align: center;
    margin-bottom: 30px;
}

.registration-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.registration-container .form-group {
    margin-bottom: 20px;
}

.registration-container .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.registration-container .form-control:focus {
    border-color: #667eea;
    outline: none;
}

.registration-container .name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Avatar selection in registration */
.registration-container .avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.registration-container .avatar-option {
    position: relative;
}

.registration-container .avatar-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.registration-container .avatar-option label {
    display: block;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s;
}

.registration-container .avatar-option label:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.registration-container .avatar-option input[type="radio"]:checked + label {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.registration-container .avatar-option img {
    width: 100%;
    height: auto;
    display: block;
}

/* Password requirements in registration */
.registration-container .password-requirements {
    font-size: 14px;
    color: #6c757d;
    margin-top: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.registration-container .password-requirements strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.registration-container .password-requirements ul {
    margin: 5px 0;
    padding-left: 20px;
}

.registration-container .password-requirements li {
    margin: 3px 0;
    transition: color 0.3s ease;
}

.registration-container .password-requirements li .requirement-icon {
    display: inline-block;
    width: 18px;
    margin-right: 5px;
    font-weight: bold;
}

.registration-container .password-requirements li.valid {
    color: #28a745;
}

.registration-container .password-requirements li.valid .requirement-icon {
    color: #28a745;
}

.registration-container .password-requirements li.valid .requirement-icon::before {
    content: '✓';
}

.registration-container .password-requirements li.invalid .requirement-icon::before {
    content: '○';
}

/* Password match indicator */
.registration-container .password-match {
    font-size: 14px;
    margin-top: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #6c757d;
    transition: all 0.3s ease;
}

.registration-container .password-match .match-icon {
    display: inline-block;
    width: 18px;
    margin-right: 5px;
    font-weight: bold;
}

.registration-container .password-match.valid {
    color: #28a745;
    border-left-color: #28a745;
}

.registration-container .password-match.valid .match-icon::before {
    content: '✓';
    color: #28a745;
}

.registration-container .password-match.invalid {
    color: #dc3545;
    border-left-color: #dc3545;
}

.registration-container .password-match.invalid .match-icon::before {
    content: '✗';
    color: #dc3545;
}

/* Submit button */
.registration-container .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.registration-container .btn-primary:hover {
    transform: translateY(-2px);
}

/* CGU checkbox */
.cgu-checkbox {
    display: flex;
    align-items: start;
    gap: 10px;
}

.cgu-checkbox input {
    margin-top: 4px;
}

.cgu-checkbox label {
    flex: 1;
}

.cgu-checkbox a {
    color: #667eea;
    text-decoration: none;
}

.cgu-checkbox a:hover {
    text-decoration: underline;
}

/* Login link */
.login-link {
    text-align: center;
    margin-top: 20px;
}

.login-link a {
    color: #667eea;
}

/* Error message */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    /* Descendre user et share de 5px sur les pages auth */
    body:has(.login-page) .user-account-bar {
        top: 120px;
    }
    body:has(.login-page) .user-account-bar.sticky-scrolled {
        top: 17px;
    }
    body:has(.login-page) .share-bar {
        top: -35px;
    }
    body:has(.login-page) .share-bar.sticky-scrolled {
        top: -140px;
    }

    .login-container {
        padding: 2rem;
        margin: 0 auto;
        margin-top: 35px;
        max-width: calc(100% - 1rem);
    }

    .register-container,
    .password-reset-container {
        padding: 1.5rem;
        margin: 2rem auto;
        max-width: calc(100% - 2rem);
    }

    .registration-container {
        padding: 1.5rem;
        margin: 55px auto 2rem;
        max-width: calc(100% - 2rem);
    }

    .reset-container {
        padding: 1.5rem;
        margin: 55px auto 2rem;
        max-width: calc(100% - 2rem);
    }

    .login-header h1,
    .register-header h1,
    .password-reset-header h1,
    .registration-header h1 {
        font-size: 1.5rem;
    }

    .registration-container .name-grid {
        grid-template-columns: 1fr;
    }

    .registration-container .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
