/* ==========================================================================
   ScribeClin - Tela de Autenticação e Bloqueio
   ========================================================================== */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 0%, #131629 0%, var(--bg-primary) 70%);
    overflow-y: auto;
}
.auth-overlay.hidden { display: none; }

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 34px 32px;
    box-shadow: var(--shadow-premium);
    animation: auth-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes auth-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-bottom: 26px;
}
.auth-brand .logo-icon { width: 24px; height: 24px; color: var(--color-primary); }
.auth-brand h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.auth-panel.hidden { display: none; }
.auth-panel h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 9px;
}
.auth-lead {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 22px;
}
.auth-lead strong { color: var(--text-main); font-weight: 600; }

.auth-field { margin-bottom: 18px; }
.auth-field > label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 7px;
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glass);
    border-radius: 9px;
    padding: 11px 42px 11px 13px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    transition: var(--transition-smooth);
}
.auth-input-wrap input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12);
}
.auth-eye {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 7px;
    border-radius: 6px;
    display: flex;
    transition: var(--transition-smooth);
}
.auth-eye:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.04); }
.auth-eye i { width: 16px; height: 16px; }

.auth-hint {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 7px;
    line-height: 1.5;
}
.auth-error { color: #fca5a5; }
.auth-error.hidden { display: none; }

/* Medidor de força da senha */
.strength-meter {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 9px;
}
.strength-meter span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width 0.3s ease, background 0.3s ease;
}
.strength-meter span.weak { background: #ef4444; }
.strength-meter span.fair { background: #f59e0b; }
.strength-meter span.good { background: #84cc16; }
.strength-meter span.strong { background: var(--status-ready); }

/* Aviso de irreversibilidade */
.auth-warning {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 13px 14px;
    margin-bottom: 18px;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.auth-warning i {
    width: 17px;
    height: 17px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 1px;
}
.auth-warning strong { display: block; color: #fcd34d; margin-bottom: 3px; }
.auth-warning code {
    background: rgba(255, 255, 255, 0.07);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

.auth-panel .checkbox-container { margin-bottom: 20px; font-size: 0.79rem; }
.auth-panel .btn-full { justify-content: center; }

.auth-link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.77rem;
    text-decoration: underline;
    text-align: center;
    margin-top: 15px;
    padding: 6px;
    transition: var(--transition-smooth);
}
.auth-link:hover { color: var(--color-primary); }

/* Chave de recuperação */
.recovery-code {
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    color: var(--color-primary);
    background: var(--bg-tertiary);
    border: 1px dashed rgba(var(--color-primary-rgb), 0.45);
    border-radius: 10px;
    padding: 18px 12px;
    margin-bottom: 16px;
    user-select: all;
    word-break: break-all;
}
.recovery-actions {
    display: flex;
    gap: 9px;
    margin-bottom: 20px;
}
.recovery-actions .btn { flex: 1; justify-content: center; }

.recovery-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-glass);
    border-radius: 9px;
    padding: 12px 13px;
    color: var(--text-main);
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}
.recovery-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12);
}

/* Sidebar: botão de bloquear */
.btn-lock:hover {
    border-color: rgba(245, 158, 11, 0.5);
    color: #fcd34d;
}

/* Configurações: bloco de segurança */
.form-divider {
    border: none;
    border-top: 1px solid var(--border-glass);
    margin: 22px 0;
}
.security-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
