/**
 * Auth Pages - Jeety CRM
 * Styles pour les pages de connexion et inscription
 * Basé sur la maquette jeety-auth (9).html
 */

/* === Page d'authentification === */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    min-height: 100vh;
}

/* === Header simplifié === */
.auth-header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 16px 32px;
}

.auth-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
}

.auth-logo:hover {
    text-decoration: none;
}

.auth-logo-img {
    height: 36px;
}

.auth-header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.auth-header-link {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-header-link:hover {
    color: #003D7A;
}

/* === Container principal === */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: calc(100vh - 120px);
}

.auth-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    width: fit-content;
    min-height: 580px;
    overflow: hidden;
}

/* === Section Connexion === */
.login-section {
    width: 420px;
    min-width: 420px;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    color: #212529;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 32px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    background: #f8f9fa;
}

.form-input:focus {
    outline: none;
    border-color: #003D7A;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 61, 122, 0.1);
}

.form-input::placeholder {
    color: #adb5bd;
}

/* Password input avec bouton œil */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 85px;
    flex: 1;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 20px;
    color: #6c757d;
    transition: all 0.2s;
    user-select: none;
    border-radius: 6px;
    line-height: 1;
}

.password-toggle-btn:hover {
    color: #003D7A;
    background: #f8f9fa;
}

.password-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.forgot-password {
    text-align: right;
    margin-bottom: 24px;
}

.forgot-password a {
    font-size: 13px;
    color: #E6007E;
    text-decoration: none;
    font-weight: 500;
}

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

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #003D7A 0%, #002952 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 61, 122, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === Séparateur === */
.divider {
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, #e9ecef 20%, #e9ecef 80%, transparent 100%);
    position: relative;
}

.divider::after {
    content: 'ou';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 12px 8px;
    font-size: 12px;
    color: #adb5bd;
    font-weight: 500;
}

/* === Section Inscription avec Slider === */
.register-section {
    width: 500px;
    min-width: 500px;
    padding: 48px 40px;
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    position: relative;
}

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 700%; /* 7 slides */
}

.slide {
    width: calc(100% / 7); /* 14.285% chacune */
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Progress dots */
.slider-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.progress-dot {
    width: 32px;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    transition: all 0.3s;
}

.progress-dot.active {
    background: #E6007E;
    width: 48px;
}

.progress-dot.completed {
    background: #E6007E;
}

/* Cards de choix */
.choice-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.choice-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.choice-card:hover {
    border-color: #003D7A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.choice-card.selected {
    border-color: #003D7A;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
}

.choice-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.choice-icon.artisan {
    background: linear-gradient(135deg, #FFF4E6 0%, #FFE8CC 100%);
}

.choice-icon.beneficiaire {
    background: linear-gradient(135deg, #E6F7FF 0%, #CCE8FF 100%);
}

.choice-icon.particulier {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.choice-icon.societe {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
}

.choice-content {
    flex: 1;
}

.choice-title {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 6px;
}

.choice-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
}

.choice-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
    transition: all 0.2s;
}

.choice-card.selected .choice-radio {
    border-color: #003D7A;
    background: #003D7A;
}

.choice-card.selected .choice-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Navigation buttons */
.slider-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
}

.btn-back-slide {
    padding: 12px 24px;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-back-slide:hover {
    background: #e9ecef;
}

.btn-next-slide {
    padding: 12px 24px;
    background: linear-gradient(135deg, #E6007E 0%, #B8005F 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-next-slide:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 0, 126, 0.3);
}

.btn-next-slide:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* API Status */
.api-status {
    margin-top: 8px;
    font-size: 12px;
    min-height: 18px;
}

.api-status.loading {
    color: #FFA459;
}

.api-status.success {
    color: #00965E;
}

.api-status.error {
    color: #dc3545;
}

/* Prefilled fields */
.prefilled-fields {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid #e9ecef;
}

.prefilled-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.prefilled-value {
    font-size: 14px;
    color: #212529;
    font-weight: 500;
}

.prefilled-row {
    margin-bottom: 12px;
}

.prefilled-row:last-child {
    margin-bottom: 0;
}

/* Success screen */
.success-screen {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
}

.success-title {
    font-size: 22px;
    font-weight: 800;
    color: #212529;
    margin-bottom: 12px;
}

.success-text {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

.success-email {
    display: inline-block;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    color: #003D7A;
    margin-top: 16px;
}

/* Input avec button recherche */
.input-with-button {
    display: flex;
    gap: 12px;
}

.input-with-button .form-input {
    flex: 1;
}

.btn-search {
    padding: 12px 20px;
    background: linear-gradient(135deg, #003D7A 0%, #002952 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 61, 122, 0.3);
}

.btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

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

.slide {
    animation: fadeIn 0.3s ease-out;
}

/* === Footer === */
.auth-footer {
    background: white;
    padding: 16px 32px;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}

.auth-footer a {
    color: #003D7A;
    text-decoration: none;
    margin: 0 12px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* === Alert messages === */
.auth-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-alert-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.auth-alert-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.auth-alert-info {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

/* === Responsive === */
@media (max-width: 900px) {
    .auth-container {
        flex-direction: column;
        max-width: 500px;
    }

    .login-section,
    .register-section {
        width: 100%;
        min-width: auto;
    }

    .divider {
        width: 100%;
        height: 1px;
        background: linear-gradient(90deg, transparent 0%, #e9ecef 20%, #e9ecef 80%, transparent 100%);
    }

    .divider::after {
        padding: 8px 12px;
    }
}

@media (max-width: 576px) {
    .auth-header {
        padding: 12px 16px;
    }
    
    .auth-main {
        padding: 20px 12px;
    }
    
    .login-section,
    .register-section {
        padding: 32px 24px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
    }
}
