@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1a1a2e;
    --muted: #6b7280;
    --light: #9ca3af;
    --border: #e5e7eb;
    --input-border: #d1d5db;
    --focus: #1a1a2e;
    --btn: #1a1a2e;
    --btn-hover: #111122;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --radius: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 8px 40px rgba(0, 0, 0, .06);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(0, 0, 0, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, .03) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text);
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 24px 32px 32px;
    box-shadow: var(--shadow);
}

.auth-logo {
    display: block;
    max-height: 200px;
    width: 200px;
    margin-bottom: 24px;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.auth-tab {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.auth-tab:hover {
    color: var(--text);
    border-color: var(--text);
}

.auth-tab.active {
    color: #fff;
    background: var(--btn);
    border-color: var(--btn);
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.form-label-row label {
    margin-bottom: 0;
}

.form-label-row a {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
}

.form-label-row a:hover {
    color: var(--text);
    text-decoration: underline;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    outline: none;
}

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

.form-group input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, .06);
}

/* Input wrap for password toggle */
.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-right: 44px;
}

.input-wrap .toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    padding: 2px 4px;
}

.input-wrap .toggle-pw:hover {
    color: var(--text);
}

/* Two columns */
.form-row {
    display: flex;
    gap: 12px;
}

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

/* Primary Button */
.btn-primary {
    display: block;
    width: 100%;
    padding: 13px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--btn);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    margin-top: 6px;
    text-align: center;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--btn-hover);
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

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

/* Social Buttons */
.social-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-social {
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-social:hover {
    border-color: #bbb;
    background: #fafafa;
}

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

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--muted);
}

.auth-footer a {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
}

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

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

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

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 18px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

/* Back link */
.back-link {
    display: inline-block;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
}

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

/* Subtitle */
.auth-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Card title */
.auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

/* Password strength */
.pw-strength {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.pw-strength .bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
}

.pw-strength .bar.weak {
    background: #ef4444;
}

.pw-strength .bar.medium {
    background: #f59e0b;
}

.pw-strength .bar.strong {
    background: #10b981;
}

.strength-text {
    font-size: 11px;
    color: var(--light);
    margin-top: 4px;
}

/* OTP */
.otp-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 24px 0;
}

.otp-group input {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.otp-group input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, .06);
}

.timer-text {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

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

.resend-link {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.resend-link.disabled {
    color: var(--light);
    pointer-events: none;
    text-decoration: none;
}

/* Success */
.success-state {
    text-align: center;
    padding: 16px 0;
}

.success-state h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.success-state p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px 24px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .otp-group input {
        width: 40px;
        height: 44px;
        font-size: 18px;
    }
}

/* ═══════════════════════════════════════════════════════════
   PAGE-HEADER — barre sticky logo + titre côte à côte
   Épaisseur fixe : modifiez UNIQUEMENT "height" ici.
   Taille logo    : modifiez UNIQUEMENT ".page-header__logo height"
   ═══════════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 72px;
    /* ← épaisseur fixe de la bande */
    padding: 0 32px;
    box-sizing: border-box;
    overflow: hidden;
    /* logo > hauteur bande → rogné proprement */
    background: #ffffff;
    border-bottom: 1px solid rgba(10, 56, 108, .09);
    box-shadow: 0 1px 8px rgba(10, 56, 108, .07);
    position: sticky;
    top: 0;
    z-index: 200;
}

.page-header__logo {
    height: 240px !important;
    /* ← taille logo — agrandissez librement */
    width: auto !important;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(10, 56, 108, .12));
    transition: opacity .2s ease;
    margin: 0 !important;
    border-radius: 0 !important;
}

.page-header__logo:hover {
    opacity: .85;
}

.page-header__divider {
    width: 1px;
    height: 28px;
    background: rgba(10, 56, 108, .15);
    flex-shrink: 0;
}

.page-header__title {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #0a386c 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -.3px;
    line-height: 1.2;
}

/* body override when page-header is used — remove the centering flex */
body.has-header {
    display: block;
    align-items: unset;
    justify-content: unset;
    padding: 0;
    min-height: 100vh;
}

body.has-header .auth-card {
    margin: 48px auto;
}

/* ── Two-panel layout (forgot-password, reset-password) ──── */
.auth-page {
    min-height: calc(100vh - 72px);
    /* subtract header */
    display: flex;
    align-items: stretch;
}

.auth-brand {
    width: 380px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #0a386c 0%, #1e3a8a 60%, #2563eb 100%);
    color: #fff;
    padding: 56px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand-logo {
    height: 240px !important;
    /* ← même taille que page-header__logo */
    width: auto !important;
    display: block;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, .2));
    margin: 0 !important;
    border-radius: 0 !important;
}

.brand-tagline {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.brand-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, .75);
    line-height: 1.6;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, .88);
}

.brand-feature-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bg);
}

.auth-form-panel .auth-card {
    margin: 0;
    width: 100%;
    max-width: 440px;
}

/* mobile logo (shown only on small screens) */
.mobile-logo {
    display: none;
    height: 200px !important;
    width: auto !important;
    margin: 0 auto 24px !important;
    object-fit: contain;
    border-radius: 0 !important;
}

/* ── Input with icon prefix ─────────────────────────────── */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    pointer-events: none;
    line-height: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 38px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, .06);
}

/* ── Select ────────────────────────────────────────────────── */
.form-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-group select:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, .06);
}

/* ── Responsive two-panel ─────────────────────────────────── */
@media (max-width: 768px) {
    .auth-brand {
        display: none;
    }

    .mobile-logo {
        display: block;
    }

    .auth-page {
        flex-direction: column;
    }

    .auth-form-panel {
        padding: 24px 16px;
    }
}

/* ── Emoji Replacement Icons ✨ ────────────────────────── */
.emoji-icon {
    width: 1.25em;
    height: 1.25em;
    vertical-align: middle;
    object-fit: contain;
    display: inline-block;
    border-radius: 0 !important;
    margin: 0 !important;
    transition: transform 0.2s ease !important;
}

.emoji-icon:hover {
    transform: scale(1.1) !important;
}