/* =========================================================
   Three Health — base visual compartilhada por todas as páginas
   (tokens, tipografia, logo, header, rodapé, botões, campos e avisos).
   Estilos específicos de cada tela ficam em style.css ou no próprio template.
   ========================================================= */

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

/* ===== Tokens ===== */
:root {
    /* Marca */
    --primary: #1B72E8;
    --primary-dark: #155FC4;
    --primary-light: #EAF2FD;
    --primary-border: #bfdbfe;
    --primary-ring: rgba(27, 114, 232, 0.16);
    --green: #22C97A;

    /* Estados */
    --success: #16a34a;
    --success-dark: #166534;
    --success-light: #f0fdf4;
    --success-border: #86efac;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --danger-light: #fef2f2;
    --danger-border: #fca5a5;
    --warning: #d97706;
    --warning-dark: #92400e;
    --warning-light: #fefce8;
    --warning-border: #fde68a;

    /* Texto e superfícies */
    --text: #1e293b;
    --text-label: #374151;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --card-bg: var(--surface);
    --border: #e2e8f0;
    --border-input: #d1d5db;

    /* Forma */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.10);

    --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Base ===== */
body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Logo ===== */
.logo {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
}

.logo-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-bottom: 2px;
}

.logo-lines span {
    display: block;
    height: 5px;
    border-radius: 3px;
    background: var(--green);
}

.logo-lines span:nth-child(1) { width: 34px; }
.logo-lines span:nth-child(2) { width: 27px; }
.logo-lines span:nth-child(3) { width: 20px; }

.logo-wordmark {
    font-family: var(--font);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-underline {
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    margin-top: 5px;
}

/* ===== Header ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 2rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.header-actions .btn-primary {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1.5px solid var(--primary);
}

/* ===== Rodapé ===== */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 1.25rem 1.5rem;
    font-size: 0.8rem;
}

.site-footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

/* Logo reduzido (rodapé) */
.logo-sm .logo-row { gap: 7px; }
.logo-sm .logo-lines { gap: 3px; }
.logo-sm .logo-lines span { height: 3px; }
.logo-sm .logo-lines span:nth-child(1) { width: 20px; }
.logo-sm .logo-lines span:nth-child(2) { width: 16px; }
.logo-sm .logo-lines span:nth-child(3) { width: 12px; }
.logo-sm .logo-wordmark { font-size: 1.25rem; }
.logo-sm .logo-underline { margin-top: 3px; height: 1.5px; }

.site-footer-note {
    color: var(--text-subtle);
}

/* ===== Botões ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--primary-light);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.btn-ghost:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.btn-secondary.is-current {
    background: var(--primary-light);
}

.btn-small {
    padding: 0.375rem 0.875rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    flex-shrink: 0;
}

/* ===== Avisos (flash) ===== */
.flash {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.87rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.flash-error   { background: var(--danger-light);  border-color: var(--danger-border);  color: var(--danger-dark); }
.flash-info    { background: var(--primary-light); border-color: var(--primary-border); color: var(--primary-dark); }
.flash-success { background: var(--success-light); border-color: var(--success-border); color: var(--success-dark); }
.flash-warning { background: var(--warning-light); border-color: var(--warning-border); color: var(--warning-dark); }

/* ===== Páginas de cartão centralizado (login, acesso, senha, pagamento) ===== */
.auth-page {
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    width: 100%;
    padding: 2.5rem 2rem;
}

.auth-card .logo {
    margin-bottom: 1.75rem;
}

.auth-card h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.auth-card .subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* Campos das páginas de cartão */
.auth-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-label);
    margin-bottom: 0.3rem;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="tel"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
    font-family: inherit;
}

.auth-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.auth-card input::placeholder {
    color: var(--text-subtle);
}

.auth-card .divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0 1.1rem;
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: center;
}

.auth-links a {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

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

.auth-links .link-muted {
    color: var(--text-subtle);
    font-weight: 400;
    font-size: 0.8rem;
}

.auth-links .link-muted:hover {
    color: var(--text-muted);
}

/* ===== Responsivo ===== */
@media (max-width: 600px) {
    .site-header {
        padding: 0.75rem 1rem;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 0.65rem;
    }

    .site-header .logo-wordmark {
        font-size: 1.6rem;
    }

    .header-actions {
        gap: 0.4rem;
    }

    .header-actions .btn-primary,
    .header-actions .btn-secondary,
    .header-actions .btn-ghost {
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }

    .site-footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-card {
        padding: 2rem 1.25rem;
    }
}

/* ===== Ícones ===== */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Ícone grande dentro de um círculo (estados, etapas, upload) */
.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
}

.icon-badge.is-success { background: var(--success-light); color: var(--success); }
.icon-badge.is-danger  { background: var(--danger-light);  color: var(--danger); }
.icon-badge.is-warning { background: var(--warning-light); color: var(--warning); }

/* Botão mostrar/ocultar senha: alterna entre os dois ícones */
.pw-toggle { display: flex; align-items: center; }
.pw-toggle .icon-hide,
.pw-toggle.is-visible .icon-show { display: none; }
.pw-toggle.is-visible .icon-hide { display: inline-block; }

/* ===== Toasts (avisos temporários) ===== */
.toast-region {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: max-content;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success .icon { color: #4ade80; }
.toast-error   .icon { color: #f87171; }
.toast-warning .icon { color: #fbbf24; }
.toast-info    .icon { color: #93c5fd; }

/* ===== Erro de campo ===== */
.field-error {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--danger-dark);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.4rem;
}

.field-error[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .toast { transition: none; }
}
