/* ============================================
   Register Page — Mon7up
   ============================================ */

:root {
    --reg-accent: #6366f1;
    --reg-accent-hover: #4f46e5;
    --reg-bg: #f8fafc;
    --reg-surface: #ffffff;
    --reg-border: #e5e7eb;
    --reg-text: #1e293b;
    --reg-muted: #64748b;
    --reg-success: #22c55e;
    --reg-error: #ef4444;
    --reg-warning: #f59e0b;
    --reg-brand-bg: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    --reg-google-bg: #ffffff;
    --reg-google-border: #dadce0;
    --reg-google-text: #3c4043;
    --reg-radius: 10px;
    --reg-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --reg-bg: #0f172a;
    --reg-surface: #1e293b;
    --reg-border: #334155;
    --reg-text: #f1f5f9;
    --reg-muted: #94a3b8;
    --reg-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --reg-google-bg: #1e293b;
    --reg-google-border: #475569;
    --reg-google-text: #e2e8f0;
}

.register-page {
    min-height: 100vh;
    background: var(--reg-bg);
    display: flex;
    flex-direction: column;
}

.register-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin-top: 60px;
}

.register-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 100%;
    gap: 48px;
    align-items: center;
}

/* ---- Colonne gauche : Branding ---- */
.register-brand {
    padding: 40px 0;
}

.register-brand__logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.register-brand__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--reg-text);
    line-height: 1.2;
    margin-bottom: 24px;
}

.register-brand__title span {
    color: var(--reg-accent);
}

.register-brand__features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}

.register-brand__features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--reg-muted);
    font-size: 0.95rem;
    padding: 8px 0;
}

.register-brand__features li svg {
    flex-shrink: 0;
    color: var(--reg-success);
}

.register-brand__counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    padding: 8px 20px;
    font-size: 0.9rem;
    color: var(--reg-accent);
    font-weight: 600;
    margin-bottom: 32px;
}

.register-brand__counter .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--reg-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.register-brand__why {
    margin-top: 8px;
}

.register-brand__why h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--reg-muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.register-brand__why ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.register-brand__why ul li {
    color: var(--reg-muted);
    font-size: 0.9rem;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.register-brand__why ul li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--reg-accent);
    font-weight: bold;
}

/* ---- Colonne droite : Card formulaire ---- */
.register-card {
    background: var(--reg-surface);
    border-radius: var(--reg-radius);
    box-shadow: var(--reg-shadow);
    border: 1px solid var(--reg-border);
    padding: 36px;
}

.register-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--reg-text);
    margin-bottom: 24px;
    text-align: center;
}

/* ---- Google Button ---- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background: var(--reg-google-bg);
    border: 1.5px solid var(--reg-google-border);
    border-radius: 8px;
    color: var(--reg-google-text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #bdc1c6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--reg-google-text);
}

[data-theme="dark"] .btn-google:hover {
    background: #334155;
    border-color: #64748b;
}

.btn-google svg {
    flex-shrink: 0;
}

/* ---- Separator ---- */
.register-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--reg-muted);
    font-size: 0.85rem;
}

.register-separator::before,
.register-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--reg-border);
}

/* ---- Form inputs ---- */
.reg-field {
    margin-bottom: 18px;
    position: relative;
}

.reg-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--reg-text);
    margin-bottom: 6px;
}

.reg-field .input-wrap {
    position: relative;
}

.reg-field input {
    width: 100%;
    padding: 11px 14px;
    padding-right: 40px;
    border: 1.5px solid var(--reg-border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--reg-text);
    background: var(--reg-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.reg-field input::placeholder {
    color: var(--reg-muted);
    opacity: 0.7;
}

.reg-field input:focus {
    border-color: var(--reg-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.reg-field input.is-valid {
    border-color: var(--reg-success);
}

.reg-field input.is-invalid {
    border-color: var(--reg-error);
}

.reg-field .field-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.reg-field input.is-valid ~ .field-icon.icon-valid,
.reg-field input.is-invalid ~ .field-icon.icon-invalid {
    display: block;
}

.reg-field .field-message {
    font-size: 0.8rem;
    margin-top: 4px;
    min-height: 18px;
}

.reg-field .field-message.text-success {
    color: var(--reg-success);
}

.reg-field .field-message.text-error {
    color: var(--reg-error);
}

/* ---- Password toggle ---- */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--reg-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.toggle-password:hover {
    color: var(--reg-text);
}

.reg-field input[type="password"] ~ .toggle-password,
.reg-field input[type="text"] ~ .toggle-password {
    display: block;
}

.reg-field input.is-valid ~ .toggle-password,
.reg-field input.is-invalid ~ .toggle-password {
    right: 38px;
}

/* ---- Password strength meter ---- */
.password-meter {
    margin-top: 8px;
}

.password-meter__bar {
    height: 4px;
    border-radius: 2px;
    background: var(--reg-border);
    overflow: hidden;
    margin-bottom: 4px;
}

.password-meter__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
    width: 0;
}

.password-meter__label {
    font-size: 0.78rem;
    color: var(--reg-muted);
}

.password-meter[data-score="0"] .password-meter__fill,
.password-meter[data-score="1"] .password-meter__fill {
    width: 20%;
    background: var(--reg-error);
}

.password-meter[data-score="2"] .password-meter__fill {
    width: 40%;
    background: var(--reg-warning);
}

.password-meter[data-score="3"] .password-meter__fill {
    width: 60%;
    background: var(--reg-warning);
}

.password-meter[data-score="4"] .password-meter__fill {
    width: 80%;
    background: var(--reg-success);
}

.password-meter[data-score="5"] .password-meter__fill {
    width: 100%;
    background: var(--reg-success);
}

/* ---- Checkboxes ---- */
.reg-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: var(--reg-muted);
}

.reg-checkbox input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--reg-accent);
    flex-shrink: 0;
}

.reg-checkbox a {
    color: var(--reg-accent);
    font-weight: 600;
    text-decoration: none;
}

.reg-checkbox a:hover {
    text-decoration: underline;
}

/* ---- Submit button ---- */
.btn-register {
    width: 100%;
    padding: 13px 24px;
    background: var(--reg-accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 8px;
    position: relative;
}

.btn-register:hover {
    background: var(--reg-accent-hover);
}

.btn-register:active {
    transform: scale(0.98);
}

.btn-register:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-register .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

.btn-register.loading .spinner {
    display: inline-block;
}

.btn-register.loading .btn-text {
    opacity: 0.7;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Footer link ---- */
.register-card__footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--reg-muted);
}

.register-card__footer a {
    color: var(--reg-accent);
    font-weight: 600;
    text-decoration: none;
}

.register-card__footer a:hover {
    text-decoration: underline;
}

/* ---- Toast notification ---- */
.reg-toast {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #1e293b;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 420px;
    line-height: 1.4;
}

[data-theme="dark"] .reg-toast {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.reg-toast.show {
    transform: translateX(0);
}

.reg-toast.success {
    border-left: 5px solid #22c55e;
}

.reg-toast.error {
    border-left: 5px solid #ef4444;
}

.reg-toast svg {
    flex-shrink: 0;
}

/* ---- Verify banner ---- */
.verify-banner {
    background: var(--reg-surface);
    border-radius: var(--reg-radius);
    box-shadow: var(--reg-shadow);
    border: 1px solid var(--reg-border);
    padding: 48px;
    text-align: center;
    max-width: 500px;
    margin: 120px auto 40px;
}

.verify-banner__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.verify-banner__icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--reg-success);
}

.verify-banner__icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--reg-error);
}

.verify-banner h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--reg-text);
    margin-bottom: 12px;
}

.verify-banner p {
    color: var(--reg-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.verify-banner .btn-register {
    max-width: 280px;
    margin: 0 auto;
    display: block;
    text-align: center;
    text-decoration: none;
    line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .register-wrapper {
        padding: 20px 16px;
        margin-top: 50px;
    }

    .register-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .register-brand {
        display: none;
    }

    .register-card {
        padding: 28px 24px;
        border-radius: 12px;
    }

    .register-card__title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .register-card {
        padding: 24px 18px;
    }

    .reg-toast {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/* ============================================
   Login Modal — Mon7up
   ============================================ */

#exampleModalCenter .modal-content {
    border-radius: 12px;
    border: none;
    background: var(--reg-surface);
    box-shadow: var(--reg-shadow);
    overflow: hidden;
}

.login-modal {
    padding: 32px;
}

.login-modal .register-card__title {
    margin-bottom: 20px;
}

.login-modal__error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--reg-error);
    font-weight: 500;
}

.login-modal__error svg {
    flex-shrink: 0;
}

.login-modal__forgot {
    color: var(--reg-accent);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.login-modal__forgot:hover {
    text-decoration: underline;
    color: var(--reg-accent-hover);
}

.login-modal__footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--reg-border);
    font-size: 0.9rem;
    color: var(--reg-muted);
}

.login-modal__footer a {
    color: var(--reg-accent);
    font-weight: 600;
    text-decoration: none;
}

.login-modal__footer a:hover {
    text-decoration: underline;
}

.login-modal__sep {
    margin: 0 6px;
    color: var(--reg-muted);
}

@media (max-width: 480px) {
    .login-modal {
        padding: 24px 18px;
    }
}

/* Login notifications (AJAX) */
.login-notif {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: loginNotifIn .3s ease;
}
.login-notif--error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--reg-error);
}
.login-notif--warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #b45309;
}
.login-notif--blocked {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #991b1b;
}
.login-notif__msg {
    margin-bottom: 4px;
}
.login-notif__remaining {
    font-size: 0.82rem;
    opacity: 0.85;
    margin-bottom: 6px;
}
.login-notif__reset {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--reg-accent);
    text-decoration: none;
}
.login-notif__reset:hover {
    text-decoration: underline;
}

@keyframes loginNotifIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.login-shake {
    animation: loginShake .4s ease;
}

/* ============================================
   Forgot Password — Step Indicator & Alerts
   ============================================ */

.forgot-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 8px;
}

.forgot-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
}

.forgot-step__circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--reg-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--reg-muted);
    background: var(--reg-surface);
    transition: all 0.3s ease;
}

.forgot-step.active .forgot-step__circle {
    border-color: var(--reg-accent);
    color: #fff;
    background: var(--reg-accent);
}

.forgot-step.completed .forgot-step__circle {
    border-color: var(--reg-success);
    color: #fff;
    background: var(--reg-success);
}

.forgot-step__label {
    font-size: 0.75rem;
    color: var(--reg-muted);
    font-weight: 500;
    white-space: nowrap;
}

.forgot-step.active .forgot-step__label {
    color: var(--reg-accent);
    font-weight: 600;
}

.forgot-step.completed .forgot-step__label {
    color: var(--reg-success);
}

.forgot-step__line {
    flex: 1;
    height: 2px;
    background: var(--reg-border);
    min-width: 32px;
    margin: 0 4px;
    margin-bottom: 22px;
    transition: background 0.3s ease;
}

.forgot-step__line.active {
    background: var(--reg-success);
}

/* Alerts */
.forgot-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.forgot-alert svg {
    flex-shrink: 0;
}

.forgot-alert--error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--reg-error);
}

.forgot-alert--success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--reg-success);
}

/* Code input */
.forgot-code-input {
    text-align: center !important;
    letter-spacing: 4px;
    font-size: 1.2rem !important;
    font-weight: 600;
}

/* Resend */
.forgot-resend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--reg-border);
}

.forgot-resend__btn {
    background: none;
    border: none;
    color: var(--reg-accent);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.forgot-resend__btn:hover {
    text-decoration: underline;
    color: var(--reg-accent-hover);
}

@media (max-width: 480px) {
    .forgot-steps {
        gap: 0;
        padding: 0;
    }

    .forgot-step__label {
        font-size: 0.68rem;
    }

    .forgot-step__circle {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }

    .forgot-step__line {
        min-width: 20px;
    }
}
