/* ── Login NEXO — layout standalone ── */

html.auth-page,
body.auth-page {
    height: 100%;
    min-height: 100vh;
    margin: 0;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-page {
    overflow-x: hidden;
    overflow-y: auto;
    color: #1f2937;
    font-family: 'Inter', sans-serif;
}

.auth-grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 20% 40%, rgba(157, 78, 221, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 70%, rgba(106, 13, 173, 0.14), transparent 50%),
        linear-gradient(145deg, rgba(18, 2, 42, 0.72), rgba(45, 5, 80, 0.88));
}

.auth-main {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px clamp(16px, 4vw, 48px);
}

.auth-shell {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: min(600px, calc(100vh - 48px));
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 32px 80px rgba(8, 0, 20, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    animation: authShellIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ── Formulário (esquerda) ── */
.auth-form-panel {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.auth-form-header {
    padding: clamp(20px, 3vw, 28px) clamp(24px, 3.5vw, 40px) 0;
}

.auth-form-body {
    flex: 1;
    padding: 0 clamp(24px, 3.5vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-footer {
    padding: 16px clamp(24px, 3.5vw, 40px) clamp(20px, 3vw, 28px);
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    width: fit-content;
    transition: color 0.2s;
}

.auth-back:hover {
    color: #6a0dad;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-brand img {
    height: 40px;
    width: auto;
}

.auth-brand-name {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.03em;
    color: #4b0878;
}

.auth-title {
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.15;
}

.auth-subtitle {
    color: #6b7280;
    font-size: 0.94rem;
    line-height: 1.55;
    margin-bottom: 24px;
    max-width: 38ch;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.auth-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.auth-field-label-row label {
    margin-bottom: 0;
}

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

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: #9d4edd;
}

.auth-input {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 0.95rem;
    outline: none;
    background: #f9fafb;
    color: #111827;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input--icon {
    padding-left: 42px;
}

.auth-input:hover {
    border-color: #d1d5db;
    background: #fff;
}

.auth-input:focus {
    border-color: #9d4edd;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(157, 78, 221, 0.12);
}

.auth-input--password {
    padding-right: 48px;
}

.auth-toggle-pw {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.auth-toggle-pw:hover {
    color: #6a0dad;
    background: #f3f4f6;
}

.auth-toggle-pw:focus-visible {
    outline: 2px solid #9d4edd;
    outline-offset: 2px;
}

.auth-alert {
    margin: 0 0 16px;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.875rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: authShakeIn 0.35s ease;
}

@keyframes authShakeIn {
    0% { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.auth-alert--error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.auth-alert--success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6a0dad 0%, #9d4edd 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 8px 24px rgba(106, 13, 173, 0.32);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(106, 13, 173, 0.38);
}

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

.auth-submit:disabled {
    opacity: 0.85;
    cursor: wait;
}

.auth-spin {
    display: inline-block;
    animation: authSpin 0.8s linear infinite;
}

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

.auth-mobile-features {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.auth-mobile-features span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 600;
}

.auth-mobile-features i {
    color: #7c3aed;
}

.auth-help-card {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-help-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.auth-help-card-text strong {
    font-size: 0.875rem;
    color: #14532d;
}

.auth-help-card-text span {
    font-size: 0.78rem;
    color: #166534;
    line-height: 1.4;
}

.auth-help-wa {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #25d366;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.auth-help-wa:hover {
    background: #20bd5a;
    transform: translateY(-1px);
}

.auth-footer-note {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-footer-note i {
    color: #22c55e;
}

.auth-form-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
}

.auth-form-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.auth-form-links a:hover {
    color: #6a0dad;
}

.auth-form-links span {
    color: #d1d5db;
}

/* ── Showcase + chat (direita) ── */
.auth-showcase-panel {
    background: linear-gradient(165deg, #faf5ff 0%, #f5f0ff 45%, #ede9fe 100%);
    border-left: 1px solid rgba(157, 78, 221, 0.1);
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 3vw, 36px);
    position: relative;
    overflow: hidden;
}

.auth-showcase-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% 10%, rgba(157, 78, 221, 0.12), transparent 45%);
    pointer-events: none;
}

.auth-showcase-top {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(106, 13, 173, 0.1);
    color: #6a0dad;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.auth-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    animation: authPulse 2s ease-in-out infinite;
}

@keyframes authPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.auth-showcase-title {
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    font-weight: 800;
    color: #4b0878;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 16px;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    color: #4b5563;
    font-weight: 500;
}

.auth-feature-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(157, 78, 221, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c3aed;
    font-size: 0.85rem;
}

.auth-chat-card {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(157, 78, 221, 0.12);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(75, 8, 120, 0.08);
}

.auth-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0eef5;
    background: rgba(255, 255, 255, 0.95);
}

.auth-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6a0dad, #9d4edd);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.auth-chat-meta strong {
    display: block;
    font-size: 0.9rem;
    color: #111827;
    margin-bottom: 1px;
}

.auth-chat-meta span {
    font-size: 0.75rem;
    color: #16a34a;
    font-weight: 500;
}

.auth-chat-body {
    flex: 1;
    min-height: 0;
}

/* ── Responsivo ── */
@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: 440px;
    }

    .auth-showcase-panel {
        display: none;
    }

    .auth-form-body {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .auth-mobile-features {
        display: flex;
    }
}

@media (max-width: 420px) {
    .auth-help-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .auth-help-wa {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell,
    .auth-alert {
        animation: none;
    }

    .auth-badge-dot,
    .auth-spin {
        animation: none;
    }
}
