/**
 * EvoRating — connexion espace partenaire
 */

.auth-page {
    --auth-bg: #f4f5f8;
    --auth-text: #0a0a0b;
    --auth-muted: #71717a;
    --auth-border: rgba(10, 10, 11, 0.1);
    --auth-input-bg: #fff;
    --auth-danger: #dc2626;
    --auth-danger-bg: #fef2f2;
    --auth-danger-border: #fecaca;
    min-height: 100vh;
    background-color: var(--auth-bg);
    color: var(--auth-text);
}

.auth-shell {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    padding: 2.5rem 2rem 2rem;
    background: #fff;
    border: 1px solid rgba(10, 10, 11, 0.06);
    border-radius: 1.25rem;
    box-shadow:
        0 1px 2px rgba(10, 10, 11, 0.04),
        0 20px 48px rgba(10, 10, 11, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 6.5rem;
    margin-bottom: 0.5rem;
}

.auth-logo {
    display: block;
    height: 3rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transform: scale(2.5);
    transform-origin: center center;
}

.auth-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--auth-muted);
}

.auth-alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--auth-danger-border);
    background: var(--auth-danger-bg);
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.5;
}

.auth-alert__icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
    font-size: 1rem;
    color: var(--auth-danger);
}

.auth-alert__title {
    margin: 0 0 0.125rem;
    font-weight: 600;
    color: #7f1d1d;
}

.auth-alert__text {
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #3f3f46;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: #a1a1aa;
    pointer-events: none;
}

.auth-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.9375rem;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input--password {
    padding-right: 2.75rem;
}

.auth-input::placeholder {
    color: #a1a1aa;
}

.auth-input:hover {
    border-color: rgba(10, 10, 11, 0.18);
}

.auth-input:focus {
    outline: none;
    border-color: #0a0a0b;
    box-shadow: 0 0 0 3px rgba(10, 10, 11, 0.08);
}

.auth-input--error {
    border-color: var(--auth-danger);
    background: #fffbfb;
}

.auth-input--error:focus {
    border-color: var(--auth-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: #a1a1aa;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.auth-toggle-password:hover {
    color: #52525b;
    background: #f4f4f5;
}

.auth-toggle-password:focus-visible {
    outline: 2px solid #0a0a0b;
    outline-offset: 2px;
}

.auth-submit {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #0a0a0b 0%, #1f1f23 100%);
    box-shadow: 0 4px 16px rgba(10, 10, 11, 0.16);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(10, 10, 11, 0.2);
}

.auth-submit:focus-visible {
    outline: 2px solid #0a0a0b;
    outline-offset: 3px;
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #52525b;
    text-decoration: none;
    transition: color 0.2s;
}

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

.auth-back i {
    font-size: 0.8125rem;
    transition: transform 0.2s;
}

.auth-back:hover i {
    transform: translateX(-2px);
}

.auth-forgot-wrap {
    margin: 0.5rem 0 0;
    text-align: right;
}

.auth-forgot {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
}

.auth-forgot:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.auth-alert--success {
    --auth-danger: #047857;
    --auth-danger-bg: #ecfdf5;
    --auth-danger-border: #a7f3d0;
}

.auth-hint {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--auth-muted);
}

.auth-input--code {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.auth-alert--info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.auth-code-block {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #0a0a0b;
    color: #f4f4f5;
    font-size: 0.8125rem;
    overflow-x: auto;
}

/* Changement de mot de passe obligatoire (première connexion) */
.auth-page--forced {
    overflow: hidden;
}

.auth-shell--forced {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 10, 11, 0.45);
    backdrop-filter: blur(4px);
}

.auth-card--forced {
    position: relative;
    z-index: 10001;
}

.auth-forced-title {
    margin: 0.25rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-input--locked {
    background: #f4f4f5;
    color: #52525b;
    cursor: not-allowed;
}

.auth-strength {
    margin-top: 0.625rem;
}

.auth-strength__track {
    height: 0.375rem;
    border-radius: 9999px;
    background: #e4e4e7;
    overflow: hidden;
}

.auth-strength__bar {
    height: 100%;
    width: 0;
    border-radius: 9999px;
    transition: width 0.2s ease, background-color 0.2s ease;
    background: #f97316;
}

.auth-strength__bar[data-level='weak'] {
    background: #f97316;
}

.auth-strength__bar[data-level='medium'] {
    background: #eab308;
}

.auth-strength__bar[data-level='strong'] {
    background: #16a34a;
}

.auth-strength__bar[data-level='poor'] {
    background: #fb923c;
}

.auth-strength__label {
    margin: 0.375rem 0 0;
    font-size: 0.75rem;
    color: var(--auth-muted);
}

.auth-hint--forced {
    text-align: center;
}

.auth-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
