/**
 * Pages auth compactes : login + verrouillage session
 */
:root {
    --auth-primary: #2375ff;
    --auth-primary-dark: #1a5ecc;
    --auth-bg: #f0f6ff;
    --auth-card-width: min(92vw, 380px);
}

* { -webkit-tap-highlight-color: transparent; }

body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    background: linear-gradient(160deg, #e8f1ff 0%, var(--auth-bg) 50%, #f5f9ff 100%);
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.auth-wrap {
    width: var(--auth-card-width);
    max-width: 380px;
    margin-inline: auto;
    flex-shrink: 0;
}

.auth-card {
    border: none;
    border-radius: 0.875rem;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(35, 117, 255, 0.1);
    background: #fff;
}

.auth-form-panel {
    padding: 1.15rem 1.1rem 1.25rem;
    background: #fff;
}

.auth-header {
    text-align: center;
    margin-bottom: 0.85rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid #eef1f6;
}

.auth-header h5 {
    font-size: 0.95rem;
    margin: 0;
    color: var(--auth-primary);
    line-height: 1.3;
}

.auth-title {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.auth-subtitle {
    font-size: 0.8rem;
    margin-bottom: 0.85rem;
}

.auth-form-panel .form-label {
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.auth-form-panel .mb-3 {
    margin-bottom: 0.75rem !important;
}

.auth-form-panel .mb-4 {
    margin-bottom: 0.85rem !important;
}

.auth-form-panel .form-text {
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

.auth-type-label {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem !important;
}

.auth-type-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.auth-type-btn {
    border: 1px solid #e9ebef;
    background: #f8f9fb;
    border-radius: 0.35rem;
    min-height: 1.65rem;
    padding: 0.2rem 0.15rem;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.2;
    color: #6c757d;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
    text-align: center;
    touch-action: manipulation;
    user-select: none;
}

.auth-type-btn.active {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(35, 117, 255, 0.25);
}

.auth-form-panel .input-group-text {
    color: var(--auth-primary);
    background: #fff;
}

.auth-form-panel .input-group-text.password-toggle {
    cursor: pointer;
    color: #6c757d;
}

.btn-auth-submit {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 0.5rem;
    touch-action: manipulation;
    transition: opacity 0.15s ease;
}

.btn-auth-submit:active {
    opacity: 0.92;
}

.auth-footer {
    text-align: center;
    padding: 0.65rem 0 0;
    color: #878a99;
    font-size: 0.7rem;
    line-height: 1.35;
}

/* Verrouillage session */
.lock-user-block {
    text-align: center;
    margin-bottom: 0.85rem;
}

.lock-avatar {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid var(--auth-primary);
    box-shadow: 0 3px 12px rgba(35, 117, 255, 0.15);
}

.lock-user-name {
    font-size: 0.95rem;
    color: #212529;
    margin-top: 0.5rem;
    margin-bottom: 0.15rem;
    line-height: 1.3;
    word-break: break-word;
}

.lock-user-meta {
    font-size: 0.74rem;
    color: #6c757d;
    line-height: 1.4;
    word-break: break-word;
}

.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(35, 117, 255, 0.1);
    color: var(--auth-primary);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 2rem;
    margin-top: 0.4rem;
}

.lock-link-switch {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.76rem;
    line-height: 1.4;
}

.lock-link-switch a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.lock-link-switch a:hover {
    text-decoration: underline;
}

@media (max-width: 380px) {
    :root {
        --auth-card-width: min(94vw, 340px);
    }

    .auth-form-panel {
        padding: 1rem 0.95rem 1.1rem;
    }

    .lock-avatar {
        width: 52px;
        height: 52px;
    }
}
