/**
 * ============================================
 * 🔐 AUTHENTIFICATION - STYLES
 * Pages de connexion, inscription, profil
 * ============================================
 */

/* ==================== VARIABLES ==================== */
:root {
    --auth-primary: #2D5016;
    --auth-primary-dark: #1f3810;
    --auth-primary-light: #3d6b1f;
    --auth-secondary: #1E3A8A;
    --auth-accent: #10B981;
    --auth-danger: #EF4444;

    --auth-bg-light: #F9FAFB;
    --auth-bg-white: #FFFFFF;
    --auth-border: #E5E7EB;

    --auth-text-primary: #111827;
    --auth-text-secondary: #6B7280;
    --auth-text-muted: #9CA3AF;

    --auth-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --auth-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --auth-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);

    --auth-radius-sm: 0.5rem;
    --auth-radius-md: 0.75rem;
    --auth-radius-lg: 1rem;
    --auth-radius-xl: 1.5rem;
}

/* ==================== AUTH WRAPPER (LOGIN/REGISTER) ==================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

/* Décoration de fond */
.auth-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-decoration-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.auth-decoration-shape.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--auth-primary);
    top: -200px;
    left: -200px;
}

.auth-decoration-shape.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--auth-secondary);
    bottom: -150px;
    right: -150px;
}

.auth-decoration-shape.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--auth-accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    background: var(--auth-bg-white);
    border-radius: var(--auth-radius-xl);
    box-shadow: var(--auth-shadow-lg);
    padding: 3rem 2.5rem;
}

/* ==================== AUTH HEADER ==================== */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-logo-icon {
    font-size: 2.5rem;
}

.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-primary);
    font-family: 'Poppins', sans-serif;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.auth-subtitle {
    color: var(--auth-text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* ==================== ALERTS ==================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--auth-radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.alert-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-info {
    background: #EFF6FF;
    color: #1E3A8A;
    border: 1px solid #93C5FD;
}

.alert-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FCD34D;
}

/* ==================== FORM STYLES ==================== */
.auth-form {
    margin-bottom: 1.5rem;
}

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

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--auth-danger);
    margin-left: 0.25rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--auth-text-primary);
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--auth-bg-white);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-input::placeholder {
    color: var(--auth-text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-help-text {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
    margin-top: 0.5rem;
}

.form-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--auth-danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Checkbox & Radio */
.checkbox-container,
.radio-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.checkbox-container input[type="checkbox"],
.radio-container input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--auth-primary);
    margin-top: 0.125rem;
}

.checkbox-label {
    font-size: 0.9375rem;
    color: var(--auth-text-primary);
    line-height: 1.5;
}

/* Form Links */
.form-links {
    text-align: center;
    margin-top: 1rem;
}

.form-link {
    color: var(--auth-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.form-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Form Checkboxes Group */
.form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--auth-primary);
    color: var(--auth-bg-white);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
}

.btn-primary:hover {
    background: var(--auth-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 80, 22, 0.4);
}

.btn-secondary {
    background: #F3F4F6;
    color: var(--auth-text-primary);
    border: 1px solid var(--auth-border);
}

.btn-secondary:hover {
    background: #E5E7EB;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--auth-text-secondary);
    padding: 0.75rem 1.5rem;
}

.btn-ghost:hover {
    background: #F3F4F6;
    color: var(--auth-text-primary);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--auth-border);
    color: var(--auth-text-primary);
}

.btn-outline:hover {
    background: #F9FAFB;
    border-color: var(--auth-primary);
    color: var(--auth-primary);
}

.btn-danger {
    color: var(--auth-danger);
    border-color: var(--auth-danger);
}

.btn-danger:hover {
    background: #FEF2F2;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

.btn-icon {
    font-size: 1.125rem;
}

/* ==================== FORM ACTIONS ==================== */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: var(--auth-bg-white);
    padding: 1.5rem 0;
    border-top: 1px solid var(--auth-border);
    margin-top: 2rem;
}

/* ==================== AUTH FOOTER ==================== */
.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border);
    margin-top: 1.5rem;
}

.auth-footer-text {
    font-size: 0.9375rem;
    color: var(--auth-text-secondary);
}

.auth-footer-link {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-footer-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* ==================== BENEFITS (REGISTER PAGE) ==================== */
.auth-benefits {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--auth-border);
}

.benefits-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 1rem;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #F9FAFB;
    border-radius: var(--auth-radius-md);
    font-size: 0.9375rem;
    color: var(--auth-text-primary);
}

.benefit-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ==================== PROFILE PAGE ==================== */
.profile-wrapper {
    min-height: 100vh;
    background: var(--auth-bg-light);
}

.profile-header {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-secondary) 100%);
    color: var(--auth-bg-white);
    padding: 3rem 0 4rem;
    position: relative;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.profile-header-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    font-size: 3rem;
    font-weight: 700;
    color: var(--auth-bg-white);
}

.profile-info-section {
    flex: 1;
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.profile-role {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.profile-bio {
    font-size: 0.9375rem;
    opacity: 0.85;
    max-width: 600px;
    line-height: 1.6;
}

.profile-actions-section {
    display: flex;
    gap: 1rem;
}

/* Profile Content */
.profile-content {
    padding: 2rem 0;
    margin-top: -2rem;
    position: relative;
    z-index: 2;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Profile Cards */
.profile-card {
    background: var(--auth-bg-white);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-sm);
    overflow: hidden;
}

.profile-card-full {
    grid-column: 1 / -1;
}

.profile-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--auth-border);
    background: #F9FAFB;
}

.profile-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
}

.profile-card-icon {
    font-size: 1.5rem;
}

.profile-card-body {
    padding: 1.5rem;
}

/* Profile Info Grid */
.profile-info-grid {
    display: grid;
    gap: 1.5rem;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-info-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-info-value {
    font-size: 1rem;
    color: var(--auth-text-primary);
}

/* Profile Stats */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: #F9FAFB;
    border-radius: var(--auth-radius-md);
}

.profile-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--auth-primary);
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.profile-stat-label {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

/* Profile Activity */
.profile-activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: var(--auth-radius-md);
}

.profile-activity-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.profile-activity-content {
    flex: 1;
}

.profile-activity-description {
    font-size: 0.9375rem;
    color: var(--auth-text-primary);
    margin-bottom: 0.25rem;
}

.profile-activity-date {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

/* Profile Empty State */
.profile-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.profile-empty-icon {
    font-size: 4rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 1rem;
}

.profile-empty-text {
    font-size: 0.9375rem;
    color: var(--auth-text-secondary);
}

/* Profile Security */
.profile-security-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: var(--auth-radius-md);
}

.profile-security-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-security-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--auth-text-primary);
}

.profile-security-subtitle {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

/* Profile Sessions */
.profile-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: var(--auth-radius-md);
}

.profile-session-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-session-device {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--auth-text-primary);
}

.profile-session-ip,
.profile-session-date {
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background: #ECFDF5;
    color: #065F46;
}

/* ==================== PROFILE EDIT PAGE ==================== */
.profile-edit-wrapper {
    min-height: 100vh;
    background: var(--auth-bg-light);
    padding: 2rem 0;
}

.profile-edit-header {
    margin-bottom: 2rem;
}

.profile-edit-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin: 1rem 0 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.profile-edit-subtitle {
    font-size: 1rem;
    color: var(--auth-text-secondary);
}

.profile-edit-content {
    background: var(--auth-bg-white);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-sm);
    padding: 2rem;
}

.profile-edit-form {
    max-width: 900px;
}

/* Form Section */
.form-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--auth-border);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
}

.form-section-icon {
    font-size: 1.5rem;
}

/* Avatar Upload */
.avatar-upload-section {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.avatar-preview {
    flex-shrink: 0;
}

.avatar-preview-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--auth-border);
}

.avatar-preview-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--auth-primary);
    color: var(--auth-bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    border: 4px solid var(--auth-border);
}

.avatar-upload-controls {
    flex: 1;
}

.avatar-upload-controls input[type="file"] {
    display: none;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .profile-header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-avatar-section {
        justify-content: center;
    }

    .profile-actions-section {
        flex-direction: column;
        width: 100%;
    }

    .profile-actions-section .btn {
        width: 100%;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .avatar-upload-section {
        flex-direction: column;
        text-align: center;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .container {
        padding: 0 1rem;
    }

    .auth-container {
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .profile-header {
        padding: 2rem 0 3rem;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .profile-avatar-large {
        width: 100px;
        height: 100px;
    }

    .profile-edit-content {
        padding: 1.5rem;
    }

    .form-section {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }
}
