/**
 * Auth Page Styles - Login & Register
 * Design SaaS moderne inspiré de Stripe
 */

/* Body layout pour centrer le formulaire */
body {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
}

/* ========== HEADER ========== */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-dot {
    color: var(--color-primary);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-text);
}

.back-link svg {
    width: 14px;
    height: 14px;
}

/* ========== MAIN CONTENT ========== */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
}

.auth-container {
    width: 100%;
    max-width: 480px;
}

/* ========== AUTH CARD ========== */
.auth-card {
    background: var(--color-bg);
    border-radius: 16px;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.03),
        0 2px 4px rgba(0, 0, 0, 0.03),
        0 12px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* ========== TABS ========== */
.auth-tabs {
    display: flex;
    background: var(--color-surface);
    padding: 6px;
    margin: 16px 16px 0;
    border-radius: 10px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.auth-tab:hover:not(.active) {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.03);
}

.auth-tab.active {
    color: var(--color-text);
    background: var(--color-bg);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ========== FORMS ========== */
.auth-content {
    padding: 28px 40px 36px;
}

.auth-form {
    display: none;
}

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

.form-header {
    text-align: center;
    margin-bottom: 24px;
}

.form-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.form-header p {
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.5;
}

/* Form Groups avec meilleur espacement */
.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

/* Inputs style Stripe */
.auth-form .form-input,
.auth-form select.form-input {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.15s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

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

.auth-form .form-input:hover {
    border-color: #c4ccd4;
}

.auth-form .form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Select custom arrow */
.auth-form select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.auth-form select.form-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Form Row - deux colonnes */
.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.auth-form .form-row .form-group {
    margin-bottom: 0;
}

/* Form Hint style */
.auth-form .form-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

/* Language hint full width - style spécial */
.auth-form > .form-hint {
    display: block;
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: -12px;
    margin-bottom: 20px;
    padding-left: 2px;
}

/* Input Wrapper (password) */
.input-wrapper {
    position: relative;
}

.input-wrapper .form-input {
    padding-right: 44px;
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    cursor: pointer;
    transition: color 0.15s;
    padding: 4px;
    border-radius: 4px;
}

.input-icon:hover {
    color: var(--color-text-muted);
    background: var(--color-surface);
}

.input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Forgot Password */
.forgot-password {
    text-align: right;
    margin-top: 8px;
}

.forgot-password a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s;
}

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

/* Terms Checkbox */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}

.terms-checkbox label {
    font-size: 13px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1.5;
}

.terms-checkbox label a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

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

.terms-checkbox label a.visited {
    color: var(--color-success);
}

.terms-checkbox label a.visited::after {
    content: ' ✓';
    font-size: 11px;
}

.terms-checkbox input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.terms-checkbox input[type="checkbox"]:disabled + label {
    cursor: default;
}

/* Submit Button */
.auth-form .btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    margin-top: 8px;
    background: var(--color-primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-form .btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.auth-form .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* ========== ALERTS (en bas du formulaire) ========== */
#alertSuccess,
#alertError {
    display: none;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 20px;
    margin-bottom: 0;
}

#alertSuccess.visible,
#alertError.visible {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: alertSlideIn 0.3s ease-out;
}

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

/* ========== DIVIDER ========== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 28px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}

.divider span {
    padding: 0 16px;
    color: var(--color-text-light);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== SOCIAL BUTTONS ========== */
.social-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-family: var(--font-sans);
}

.social-btn:hover {
    border-color: var(--color-text-light);
    background: var(--color-surface);
}

.social-btn svg,
.social-btn img {
    width: 18px;
    height: 18px;
}

/* ========== FOOTER ========== */
.auth-footer {
    padding: 20px 40px;
    background: var(--color-surface);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    text-align: center;
}

.auth-footer p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

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

/* ========== VERIFICATION PENDING ========== */
.verification-pending {
    display: none;
    text-align: center;
}

.verification-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, #c7d2fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verification-icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}

.verification-pending h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.verification-pending p {
    color: var(--color-text-muted);
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 14px;
}

.verification-pending p:last-of-type {
    margin-bottom: 28px;
}

.verification-email {
    font-weight: 600;
    color: var(--color-text);
}

.verification-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.verification-actions .btn-secondary {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
}

/* ========== FORGOT PASSWORD FORM ========== */
.forgot-form {
    display: none;
}

.back-to-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.15s;
}

.back-to-login:hover {
    color: var(--color-text);
}

.back-to-login svg {
    width: 14px;
    height: 14px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 540px) {
    .header-container {
        padding: 0 16px;
        height: 56px;
    }

    main {
        padding: 80px 16px 32px;
    }

    .auth-container {
        max-width: 100%;
    }

    .auth-card {
        border-radius: 12px;
    }

    .auth-tabs {
        margin: 12px 12px 0;
        padding: 4px;
    }

    .auth-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .auth-content {
        padding: 24px 20px 32px;
    }

    .auth-footer {
        padding: 16px 20px;
    }

    .form-header h1 {
        font-size: 22px;
    }

    .form-header p {
        font-size: 14px;
    }

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

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

    .social-buttons {
        grid-template-columns: 1fr;
    }
}

/* ========== FOCUS STATES ACCESSIBILITY ========== */
.auth-tab:focus-visible,
.btn:focus-visible,
.form-input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form.active {
    animation: fadeIn 0.2s ease-out;
}
