@import "template.css";

:root {
    --primary: #1e1ee2;
    --primary-dark: #0f4585;
    --success: #10b981;
    --error: #ef4444;
    --text-dark: #0b0c2a;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* ============================================================================= */
/*                            CONTAINER PRINCIPAL                                 */
/* ============================================================================= */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1400px;
    width: 100%;
    background: var(--bg-white);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(11, 12, 42, 0.1);
    height: 760px;
}

/* ============================================================================= */
/*                         PARTIE GAUCHE - BRANDING                              */
/* ============================================================================= */

.auth-brand {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 80px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/login/workspace-hero.webp');
    background-size: cover;
    background-position: center;
    opacity: 1;
    z-index: 0;
}

.auth-brand::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(11, 12, 42, 0.85) 0%, rgba(15, 69, 133, 0.75) 100%);
    z-index: 0;
}

.brand-content {
    position: relative;
    z-index: 1;
    color: white;
}

.brand-logo-img {
    max-width: 200px;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
}

.brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.brand-content h1 span {
    font-style: italic;
    color: #60a5fa;
}

.brand-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 50px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.brand-features {
    display: flex;
    gap: 30px;
    margin-top: 60px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.feature-item i {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #60a5fa;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.feature-item span {
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* ============================================================================= */
/*                         PARTIE DROITE - FORMULAIRES                           */
/* ============================================================================= */

.auth-forms {
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    height: 100%;
}

@media (min-width: 1025px) {
    .auth-forms::-webkit-scrollbar {
        width: 8px;
    }

    .auth-forms::-webkit-scrollbar-track {
        background: var(--bg-light);
        border-radius: 10px;
    }

    .auth-forms::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }

    .auth-forms::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}

.form-container {
    width: 100%;
    flex-shrink: 0;
}

.mobile-welcome {
    display: none;
}

.mobile-logo {
    max-width: 100px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.mobile-welcome h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 12px;
    font-family: 'Chakra Petch', sans-serif;
}

.mobile-welcome h1 span {
    font-style: italic;
    color: var(--primary);
}

.mobile-welcome p {
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.mobile-welcome p::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--primary);
}

.auth-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    font-family: 'Chakra Petch', sans-serif;
}

.form-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid var(--error);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: #991b1b;
    font-weight: 500;
}

.alert-error i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid var(--success);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: #065f46;
    font-weight: 500;
    animation: slideDown 0.4s ease;
}

.alert-success i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================= */
/*                            CHAMPS DE FORMULAIRE                               */
/* ============================================================================= */

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group label i {
    color: var(--primary);
    font-size: 1rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(30, 30, 226, 0.1);
}

.form-group input::placeholder {
    color: #cbd5e1;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    font-size: 1.2rem;
}

.password-toggle:hover {
    color: var(--primary);
}

.password-toggle i {
    pointer-events: none;
}

/* ============================================================================= */
/*                         FORCE DU MOT DE PASSE                                 */
/* ============================================================================= */

.password-strength {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.strength-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.strength-item i {
    font-size: 0.8rem;
    color: #cbd5e1;
}

.strength-item.valid {
    color: var(--success);
}

.strength-item.valid i {
    color: var(--success);
}

.strength-item.valid i::before {
    content: "\F26A";
}

/* ============================================================================= */
/*                               CHECKBOX CGU                                     */
/* ============================================================================= */

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-checkbox label {
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.form-checkbox a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ============================================================================= */
/*                                BOUTONS                                         */
/* ============================================================================= */

.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(30, 30, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 30, 226, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ============================================================================= */
/*                              SÉPARATEURS                                       */
/* ============================================================================= */

.separator-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
    margin: 1rem 0 0.75rem 0;
}

.separator-line-with-text {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1.25rem 0;
    text-align: center;
}

.separator-line-with-text::before,
.separator-line-with-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb 50%, transparent);
}

.separator-line-with-text span {
    padding: 0 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}

/* ============================================================================= */
/*                       BOUTONS SOCIAUX (Discord + Google)                      */
/* ============================================================================= */

.quick-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem 0;
}

.quick-login-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
    text-align: center;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.btn-social-icon:hover {
    transform: translateY(-2px) scale(1.05);
    color: white;
}

.btn-social-icon:active {
    transform: translateY(0) scale(1);
}

.btn-social-icon i {
    font-size: 1.3rem;
}

/* Discord */
.btn-discord {
    background: #5865F2;
}

.btn-discord:hover {
    background: #4752C4;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
}

/* Google */
.btn-google {
    background: #4285F4;
}

.btn-google:hover {
    background: #357ae8;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.4);
}

.btn-social-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-social-icon:hover::after {
    opacity: 1;
    animation: pulse-social 1.5s infinite;
}

@keyframes pulse-social {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* ============================================================================= */
/*                              LIENS DE SWITCH                                   */
/* ============================================================================= */

.form-links {
    text-align: center;
    margin-top: 12px;
    margin-bottom: 18px;
}

.form-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.form-switch {
    text-align: center;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 2px solid var(--border);
}

.form-switch span {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-right: 8px;
}

.form-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

.form-switch a i {
    margin-right: 6px;
}

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

@media (max-width: 1024px) {
    .auth-container {
        min-height: 100vh;
        padding: 0;
    }

    .auth-split {
        grid-template-columns: 1fr;
        max-height: none;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        overflow: visible;
    }

    .auth-brand {
        display: none;
    }

    .mobile-welcome {
        display: block;
    }

    .auth-forms {
        padding: 40px 30px;
        max-height: none;
        height: auto;
        overflow-y: visible !important;
    }
}

@media (max-width: 640px) {
    .auth-container {
        padding: 0;
    }

    .auth-split {
        border-radius: 0;
        height: auto;
        min-height: 100vh;
    }

    .auth-forms {
        padding: 30px 20px;
        height: auto;
    }

    .mobile-welcome {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .mobile-logo {
        max-width: 90px;
        margin-bottom: 20px;
    }

    .mobile-welcome h1 {
        font-size: 1.4rem;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    .mobile-welcome p {
        font-size: 0.85rem;
        margin-bottom: 0;
        padding-bottom: 25px;
    }

    .auth-form h2 {
        font-size: 1.3rem;
        margin-bottom: 8px;
        margin-top: 10px;
    }

    .form-subtitle {
        font-size: 0.8rem;
        margin-bottom: 24px;
        color: var(--text-light);
    }

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

    .form-group label {
        font-size: 0.85rem;
    }

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

    .password-strength {
        grid-template-columns: 1fr;
        padding: 15px;
        margin-bottom: 18px;
    }

    .strength-item {
        font-size: 0.8rem;
    }

    .btn-primary {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .form-links {
        margin-top: 15px;
        margin-bottom: 18px;
    }

    .form-links a {
        font-size: 0.85rem;
    }

    .form-switch {
        margin-top: 20px;
        padding-top: 20px;
    }

    .form-switch span,
    .form-switch a {
        font-size: 0.85rem;
    }

    .btn-social-icon {
        width: 40px;
        height: 40px;
    }

    .btn-social-icon i {
        font-size: 1.25rem;
    }

    .quick-login-label {
        font-size: 0.75rem;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .quick-login-label {
        color: #9ca3af;
    }

    .separator-line {
        background: linear-gradient(90deg, transparent, #374151 20%, #374151 80%, transparent);
    }

    .separator-line-with-text::before,
    .separator-line-with-text::after {
        background: linear-gradient(90deg, transparent, #374151 50%, transparent);
    }

    .separator-line-with-text span {
        color: #6b7280;
    }
}