/* =========================================================
   DigitalMenu — Auth Pages
   ========================================================= */

:root {
    --auth-primary:       #6366f1;
    --auth-primary-dark:  #4f46e5;
    --auth-primary-light: rgba(99, 102, 241, 0.12);
    --auth-bg:            #f1f5f9;
    --auth-dark:          #0f172a;
    --auth-text:          #334155;
    --auth-muted:         #64748b;
    --auth-border:        #e2e8f0;
    --auth-radius:        14px;
}

/* ── Wrapper ──────────────────────────────────────────── */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    color: var(--auth-text);
}

.dm-auth-wrapper {
    min-height: 100vh;
    background: var(--auth-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Mesmos blobs em degradê da landing page (dm-landing.css) — visual
   consistente entre "vender o produto" e "entrar no produto", em vez do
   cinza neutro isolado que a tela de auth tinha antes. */
.dm-auth-wrapper::before,
.dm-auth-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.dm-auth-wrapper::before {
    width: 480px;
    height: 480px;
    background: var(--auth-primary);
    top: -180px;
    left: -140px;
}

.dm-auth-wrapper::after {
    width: 420px;
    height: 420px;
    background: var(--auth-primary-dark);
    bottom: -160px;
    right: -120px;
}

.dm-auth-wrapper > * {
    position: relative;
    z-index: 1;
}

/* ── Link "voltar para o início" ──────────────────────── */

.dm-auth-back-link {
    position: absolute;
    top: 1.75rem;
    left: 1.75rem;
    z-index: 2;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-muted);
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
}

.dm-auth-back-link:hover { color: var(--auth-primary-dark); }

@media (max-width: 576px) {
    .dm-auth-back-link { top: 1rem; left: 1rem; font-size: 0.8rem; }
}

/* ── Card ─────────────────────────────────────────────── */

.dm-auth-card {
    background: #fff;
    border-radius: var(--auth-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.08);
    border: 1px solid var(--auth-border);
    width: 100%;
    overflow: hidden;
    position: relative;
}

.dm-auth-card-sm  { max-width: 420px; }
.dm-auth-card-md  { max-width: 520px; }
.dm-auth-card-lg  { max-width: 860px; }

/* ── Brand mark (top of card) ─────────────────────────── */

.dm-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.3rem 1.6rem;
    border-bottom: 1px solid var(--auth-border);
    background: #fafbfc;
    text-decoration: none !important;
}

.dm-auth-brand-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dm-auth-brand-icon svg {
    display: block;
    border-radius: 9px;
}

.dm-auth-brand-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--auth-dark);
    letter-spacing: -0.2px;
}

/* ── Body / form area ─────────────────────────────────── */

.dm-auth-body {
    padding: 2rem 1.75rem;
}

.dm-auth-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--auth-dark);
    margin-bottom: 0.25rem;
}

.dm-auth-subtitle {
    font-size: 0.82rem;
    color: var(--auth-muted);
    margin-bottom: 1.5rem;
}

/* ── Left panel (login split layout) ─────────────────── */

.dm-auth-left {
    background: linear-gradient(160deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    min-height: 480px;
}

.dm-auth-left-icon {
    width: 84px;
    height: 84px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-auth-left-icon i {
    color: #fff;
    font-size: 2rem;
}

.dm-auth-left h3 {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.dm-auth-left p {
    color: rgba(255,255,255,0.70);
    font-size: 0.83rem;
    text-align: center;
    line-height: 1.5;
}

/* ── Form controls ────────────────────────────────────── */

.dm-auth-body .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--auth-muted);
    margin-bottom: 0.35rem;
}

.dm-auth-body .form-control {
    border-color: var(--auth-border);
    border-radius: 8px;
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem;
    color: var(--auth-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dm-auth-body .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-primary-light);
}

.dm-auth-body .dm-color-input {
    height: 42px;
    padding: 0.25rem;
    cursor: pointer;
}

.dm-auth-body .input-group-text {
    border-color: var(--auth-border);
    background: #f8fafc;
    color: var(--auth-muted);
    border-radius: 8px 0 0 8px;
    font-size: 0.8rem;
}

.dm-auth-body .input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.dm-auth-body .input-group:focus-within .input-group-text,
.dm-auth-body .input-group:focus-within .form-control {
    border-color: var(--auth-primary);
}

.dm-auth-body .input-group:focus-within .input-group-text {
    box-shadow: none;
}

/* Toggle password button */
.dm-auth-body .input-group .btn-icon-append {
    border: 1px solid var(--auth-border);
    border-left: none;
    background: #f8fafc;
    color: var(--auth-muted);
    border-radius: 0 8px 8px 0;
    padding: 0 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.dm-auth-body .input-group .btn-icon-append:hover { color: var(--auth-primary); }

.dm-auth-body .input-group:focus-within .btn-icon-append {
    border-color: var(--auth-primary);
}

/* ── Buttons ──────────────────────────────────────────── */

.btn-dm-primary {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.1s;
    cursor: pointer;
}

.btn-dm-primary:hover  { opacity: 0.88; color: #fff !important; }
.btn-dm-primary:active { transform: scale(0.98); }

.btn-dm-outline {
    background: transparent;
    color: var(--auth-primary) !important;
    border: 1px solid var(--auth-primary);
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-dm-outline:hover {
    background: var(--auth-primary-light);
    color: var(--auth-primary-dark) !important;
}

.btn-dm-ghost {
    background: transparent;
    color: var(--auth-muted) !important;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    padding: 0.55rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-dm-ghost:hover {
    background: #f1f5f9;
    color: var(--auth-text) !important;
}

/* ── Links ────────────────────────────────────────────── */

.dm-auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.dm-auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* ── Divider "ou" ─────────────────────────────────────── */

.dm-auth-divider {
    text-align: center;
    position: relative;
    color: var(--auth-muted);
    font-size: 0.78rem;
    margin: 1rem 0;
}

.dm-auth-divider::before,
.dm-auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--auth-border);
}

.dm-auth-divider::before { left: 0; }
.dm-auth-divider::after  { right: 0; }

/* ── Social buttons ───────────────────────────────────── */

.btn-social {
    border-radius: 8px;
    font-size: 0.82rem;
    padding: 0.5rem;
    color: var(--auth-text) !important;
    border-color: var(--auth-border) !important;
    background: #fff;
    transition: background 0.2s, border-color 0.2s;
}

.btn-social:hover {
    background: #f8fafc;
    border-color: #cbd5e1 !important;
}

/* ── Icon circle (success/info states) ───────────────── */

.dm-auth-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.dm-auth-icon-circle.primary {
    background: var(--auth-primary-light);
    color: var(--auth-primary);
}

.dm-auth-icon-circle.success {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.dm-auth-icon-circle.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.dm-auth-icon-circle.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

/* ── Build version badge ──────────────────────────────── */

.dm-auth-build-badge {
    /* Fixo na viewport, não relativo ao card — precisa funcionar igual em
       qualquer página que use o _LayoutLogout, mesmo as que não têm
       .dm-auth-card (ex: a própria landing, se um dia parar de se esconder). */
    position: fixed;
    top: 0;
    right: 1.25rem;
    font-size: 10px;
    color: rgba(255,255,255,0.9);
    background: var(--auth-primary);
    padding: 2px 10px;
    border-radius: 0 0 8px 8px;
    z-index: 40;
    font-weight: 500;
}

/* ── SelectClient list ────────────────────────────────── */

.dm-establishment-list-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--auth-border);
    background: #fff;
    color: var(--auth-text) !important;
    text-decoration: none !important;
    margin-bottom: 0.6rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.dm-establishment-list-item:hover {
    border-color: var(--auth-primary);
    background: var(--auth-primary-light);
    box-shadow: 0 2px 8px rgba(99,102,241,0.12);
    color: var(--auth-primary-dark) !important;
    text-decoration: none !important;
}

.dm-establishment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* ── Alert overrides ──────────────────────────────────── */

.dm-auth-body .alert {
    border-radius: 8px;
    font-size: 0.85rem;
    border: none;
    padding: 0.85rem 1rem;
}

.dm-auth-body span.text-danger {
    font-size: 0.78rem;
    margin-top: 0.25rem;
    display: block;
}

/* ── Documentos legais (Política de Privacidade / Termos de Uso) ──────────
   Carregados pelo _LayoutLogout, que é o layout dessas páginas: elas precisam
   abrir sem login (são referenciadas na tela de cadastro, antes de a conta
   existir). Texto longo, então a medida é mais larga que a dos cards de auth
   e a entrelinha é maior. */

.dm-legal-wrapper {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px 64px;
}

.dm-legal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 44px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.dm-legal-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.dm-legal-updated {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 28px;
}

.dm-legal-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 34px 0 12px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.dm-legal-card h2:first-of-type { border-top: none; padding-top: 0; }

.dm-legal-card h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #334155;
    margin: 20px 0 8px;
}

.dm-legal-card p,
.dm-legal-card li {
    font-size: 0.92rem;
    line-height: 1.75;
    color: #475569;
}

.dm-legal-card ul { padding-left: 1.2rem; margin-bottom: 16px; }
.dm-legal-card li { margin-bottom: 6px; }

.dm-legal-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 20px;
    font-size: 0.86rem;
}

.dm-legal-card th,
.dm-legal-card td {
    border: 1px solid #e2e8f0;
    padding: 9px 12px;
    text-align: left;
    vertical-align: top;
    color: #475569;
}

.dm-legal-card th { background: #f8fafc; color: #0f172a; font-weight: 700; }

/* Destaque para o que o serviço NÃO faz — é a informação que mais interessa
   a quem lê uma política de privacidade, e some se ficar no meio do corpo. */
.dm-legal-highlight {
    background: #eef2ff;
    border-left: 3px solid #6366f1;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin: 20px 0;
}

.dm-legal-highlight p:last-child { margin-bottom: 0; }

/* Marcador visual dos campos que faltam preencher antes da publicação. */
.dm-legal-todo {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.dm-legal-footer-nav {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
}

.dm-legal-footer-nav a { color: #6366f1; }

/* Rodapé com os links legais, exibido nas telas de autenticação. */
.dm-auth-legal-footer {
    text-align: center;
    padding: 18px 16px 28px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.dm-auth-legal-footer a { color: #64748b; text-decoration: underline; }
.dm-auth-legal-footer a:hover { color: #6366f1; }

@media (max-width: 576px) {
    .dm-legal-card { padding: 28px 20px; }
}

/* ── Banner de consentimento de cookies (Google Ads) ─────────────────── */
.dm-cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1080;
    width: calc(100% - 32px);
    max-width: 720px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    padding: 14px 18px;
}

.dm-cookie-banner[hidden] { display: none; }

.dm-cookie-banner p {
    margin: 0;
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--auth-text);
}

.dm-cookie-banner p a { color: var(--auth-primary-dark); text-decoration: underline; }

.dm-cookie-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.dm-cookie-banner-actions button {
    padding: 0.5rem 1.1rem;
    cursor: pointer;
}

@media (max-width: 576px) {
    .dm-cookie-banner {
        flex-direction: column;
        align-items: stretch;
        bottom: 12px;
    }

    .dm-cookie-banner-actions button { flex: 1; }
}
