/**
 * auth.css — Estilos da tela de login (tenant e master)
 * Design limpo, dark mode, card centralizado
 */

:root {
    --auth-bg:         #0f1117;
    --auth-card-bg:    #1a1d27;
    --auth-border:     rgba(255, 255, 255, 0.06);
    --auth-text:       #e2e8f0;
    --auth-muted:      #94a3b8;
    --auth-input-bg:   #0f1117;
    --auth-input-border: rgba(255, 255, 255, 0.1);
    --auth-accent:     #6366f1;
    --auth-accent-h:   #4f52c0;
    --auth-danger:     #ef4444;
    --auth-success:    #22c55e;
    --auth-radius:     12px;
    --auth-shadow:     0 20px 60px rgba(0, 0, 0, 0.5);
}

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

html, body {
    height: 100%;
}

body {
    background-color: var(--auth-bg);
    color: var(--auth-text);
    font-family: 'Inter', 'Sora', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* Fundo com padrão sutil */
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
}

/* ── Card de login ─────────────────────────────────────────────────────────── */
.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--auth-shadow);
}

/* ── Logo / Brand ──────────────────────────────────────────────────────────── */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand .brand-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--auth-accent), #8b5cf6);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
    font-size: 1.4rem;
    color: white;
}

.auth-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-text);
    line-height: 1.2;
}

.auth-brand p {
    font-size: .8rem;
    color: var(--auth-muted);
    margin-top: .25rem;
}

/* ── Formulário ────────────────────────────────────────────────────────────── */
.auth-form .form-group {
    margin-bottom: 1.1rem;
}

.auth-form label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--auth-muted);
    margin-bottom: .4rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

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

.auth-form .input-wrap i {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-muted);
    font-size: .85rem;
    pointer-events: none;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 8px;
    padding: .65rem .9rem .65rem 2.5rem;
    color: var(--auth-text);
    font-size: .875rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.auth-form input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-form input::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

/* ── Botão principal ───────────────────────────────────────────────────────── */
.btn-auth {
    width: 100%;
    padding: .75rem 1.5rem;
    background: linear-gradient(135deg, var(--auth-accent), #7c3aed);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    margin-top: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    letter-spacing: .02em;
}

.btn-auth:hover {
    opacity: .9;
}

.btn-auth:active {
    transform: scale(.98);
}

.btn-auth:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-auth .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn-auth.loading .spinner {
    display: block;
}

.btn-auth.loading .btn-label {
    display: none;
}

/* ── Mensagens de erro/sucesso ─────────────────────────────────────────────── */
.auth-alert {
    display: none;
    padding: .65rem 1rem;
    border-radius: 8px;
    font-size: .82rem;
    margin-top: 1rem;
    align-items: center;
    gap: .5rem;
}

.auth-alert.error {
    display: flex;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.auth-alert.success {
    display: flex;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

/* ── Links auxiliares ──────────────────────────────────────────────────────── */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .8rem;
    color: var(--auth-muted);
}

.auth-links a {
    color: var(--auth-accent);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ── Footer da tela de login ───────────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .72rem;
    color: rgba(148, 163, 184, 0.4);
}

/* ── Responsivo ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }
}

/* ── Animações ─────────────────────────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card {
    animation: fadeIn .3s ease-out;
}
