/* =========================================================
   MM INTRANET - AUTH.CSS
   Vibe Designer 2026 v1.1
   Tela de login com glassmorphism e animações
========================================================= */

/* ── Variáveis ── */
:root {
    --gold-1: #d5a721;
    --gold-2: #c49a1f;
    --gold-glow: rgba(213, 167, 33, 0.30);
    --gold-glow-hover: rgba(213, 167, 33, 0.40);
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.55);
    --text-dim: rgba(255, 255, 255, 0.30);
    --bg-dark: #0a0a0a;
    --bg-input: rgba(0, 0, 0, 0.30);
    --bg-input-hover: rgba(0, 0, 0, 0.35);
    --bg-input-focus: rgba(0, 0, 0, 0.45);
    --border-subtle: rgba(255, 255, 255, 0.10);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-focus: var(--gold-1);
    --error-bg: rgba(239, 68, 68, 0.12);
    --error-border: rgba(239, 68, 68, 0.25);
    --error-text: #fca5a5;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.40);
    --shadow-btn: 0 4px 16px var(--gold-glow);
    --shadow-btn-hover: 0 8px 24px var(--gold-glow-hover);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --transition-smooth: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast: 0.2s ease;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Poppins', sans-serif;
    position: relative;
    overflow: hidden;
    background: var(--bg-dark);
}

/* ── Background ── */
.auth-background-img {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.auth-background-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.02);
    transition: transform 8s ease;
}

.auth-background-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.80) 0%,
        rgba(0, 0, 0, 0.65) 50%,
        rgba(0, 0, 0, 0.80) 100%
    );
}

/* ── Card ── */
.auth-card-vibe {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    margin: 24px;
    padding: 40px 36px;
    border-radius: var(--radius-lg);

    /* Glassmorphism */
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* Borda sutil */
    border: 1px solid rgba(255, 255, 255, 0.08);

    /* Sombra */
    box-shadow:
        var(--shadow-card),
        0 0 0 1px rgba(255, 255, 255, 0.02) inset;

    /* Animação de entrada */
    animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Logo / Header ── */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(213, 167, 33, 0.25));
}

.auth-logo h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.auth-logo p {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0;
}

/* ── Formulário ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-input-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Input Wrap ── */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.auth-input-wrap > i.ph:first-child {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 2;
    transition: color var(--transition-fast);
}

.auth-input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

.auth-input-wrap input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
    opacity: 1;
}

.auth-input-wrap input:hover {
    border-color: var(--border-hover);
    background: var(--bg-input-hover);
}

.auth-input-wrap input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(213, 167, 33, 0.15);
}

.auth-input-wrap input:focus + i.ph:first-child,
.auth-input-wrap:focus-within > i.ph:first-child {
    color: var(--gold-1);
}

/* Input de senha com botão toggle */
.auth-input-wrap .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.auth-input-wrap .toggle-password:hover {
    color: rgba(255, 255, 255, 0.80);
    background: rgba(255, 255, 255, 0.06);
}

.auth-input-wrap .toggle-password:focus-visible {
    outline: 2px solid var(--gold-1);
    outline-offset: 2px;
}

.auth-input-wrap .toggle-password i {
    display: block;
}

/* ── Botão Entrar ── */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    margin-top: 4px;
    padding: 0 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--bg-dark);
    background: linear-gradient(135deg, var(--gold-1) 0%, var(--gold-2) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-btn);
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.20) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
}

.auth-btn:hover::before {
    opacity: 1;
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--gold-glow);
}

.auth-btn:focus-visible {
    outline: 2px solid var(--gold-1);
    outline-offset: 3px;
}

.auth-btn i {
    font-size: 1.125rem;
    transition: transform var(--transition-smooth);
}

.auth-btn:hover i {
    transform: translateX(3px);
}

/* Estado de loading no botão */
.auth-btn.loading {
    pointer-events: none;
    opacity: 0.85;
    cursor: wait;
}

.auth-btn.loading span {
    opacity: 0.7;
}

.auth-btn.loading i.ph-arrow-right {
    animation: spin 0.8s linear infinite;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Links ── */
.auth-links {
    margin-top: 24px;
    text-align: center;
}

.auth-links .auth-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.auth-links .auth-link:hover {
    color: var(--gold-1);
    background: rgba(213, 167, 33, 0.08);
}

.auth-links .auth-link:focus-visible {
    outline: 2px solid var(--gold-1);
    outline-offset: 2px;
}

.auth-links .auth-link i {
    font-size: 1rem;
    transition: transform var(--transition-fast);
}

.auth-links .auth-link:hover i {
    transform: translateX(-3px);
}

/* ── Mensagem de erro ── */
.auth-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 4px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-xs);
    color: var(--error-text);
    font-size: 0.8125rem;
    font-weight: 500;
    animation: shakeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.auth-error i {
    font-size: 1rem;
    flex-shrink: 0;
}

@keyframes shakeIn {
    0%   { opacity: 0; transform: translateY(-8px) scale(0.95); }
    50%  { transform: translateY(2px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Responsivo ── */
@media (max-width: 480px) {
    .auth-card-vibe {
        margin: 16px;
        padding: 32px 24px;
        border-radius: var(--radius-md);
    }

    .auth-logo h1 {
        font-size: 1.25rem;
    }

    .auth-logo img {
        width: 60px;
        height: 60px;
    }

    .auth-input-wrap input {
        height: 44px;
        font-size: 0.875rem;
    }

    .auth-btn {
        height: 46px;
    }
}

/* ── Redução de movimento ── */
@media (prefers-reduced-motion: reduce) {
    .auth-card-vibe,
    .auth-btn,
    .auth-input-wrap input,
    .auth-input-wrap > i.ph:first-child {
        animation: none;
        transition: none;
    }
}