/* ==========================================================
   SAF Brasil — base compartilhada (landing + aplicação)
   ========================================================== */
:root {
    --saf-primary: #10b981;
    --saf-primary-600: #059669;
    --saf-primary-700: #047857;
    --saf-sky: #0ea5e9;
    --saf-indigo: #6366f1;
    --saf-orange: #f97316;
    --saf-red: #ef4444;
    --saf-navy: #0b1f33;
    --saf-navy-2: #10263f;
    --saf-ink: #0f172a;
    --saf-muted: #64748b;
    --saf-soft: #f4f7fb;
    --saf-border: #e5eaf1;
    --saf-radius: 18px;
    --saf-shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
    --saf-shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, .28);
    --saf-gradient: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    --bs-font-sans-serif: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: #1e293b;
    --bs-primary: #10b981;
    --bs-primary-rgb: 16, 185, 129;
    --bs-link-color: #059669;
    --bs-link-hover-color: #047857;
    --bs-border-radius: .7rem;
    --bs-border-radius-lg: 1rem;
}

/* Escala tipográfica: tudo em rem acompanha este valor (landing sobrescreve para 15px) */
html { font-size: 14px; }
body { font-family: var(--bs-font-sans-serif); -webkit-font-smoothing: antialiased; background: #fff; line-height: 1.55; }
.min-w-0 { min-width: 0; }
.fw-800 { font-weight: 800; }

/* ---------- Logo ---------- */
.saf-logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: -.02em; color: var(--saf-ink); }
.saf-logo__mark svg { width: 34px; height: 34px; display: block; filter: drop-shadow(0 6px 12px rgba(16, 185, 129, .35)); }
.saf-logo__text { font-size: 1.2rem; }
.saf-logo__text strong { font-weight: 800; background: var(--saf-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 2px; }
.saf-logo--light { color: #fff; }

/* ---------- Botões ---------- */
.btn { font-weight: 600; }
.btn-saf {
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    background: var(--saf-gradient); border: 0; position: relative; overflow: hidden; isolation: isolate;
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn-saf::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, #059669, #0284c7); opacity: 0; transition: opacity .25s; z-index: -1; }
.btn-saf:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(16, 185, 129, .7); color: #fff; }
.btn-saf:hover::after { opacity: 1; }
.btn-saf:disabled { opacity: .7; }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.btn-soft { background: var(--saf-soft); border: 1px solid var(--saf-border); color: var(--saf-ink); }
.btn-soft:hover { background: #e9eef5; }
.btn-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border-radius: 10px; }
.shadow-glow { box-shadow: 0 16px 40px -12px rgba(16, 185, 129, .8); }

.text-gradient { background: linear-gradient(90deg, #6ee7b7, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-gradient-dark { background: var(--saf-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Chips / badges ---------- */
.chip { --chip: #10b981; display: inline-flex; align-items: center; font-size: .78rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px; white-space: nowrap; line-height: 1.4;
    background: color-mix(in srgb, var(--chip) 12%, #fff); color: color-mix(in srgb, var(--chip) 80%, #000); border: 1px solid color-mix(in srgb, var(--chip) 25%, #fff); }
.chip--solid { background: var(--chip); color: #fff; border-color: transparent; }
.chip--light { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); }
.level-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; color: #fff; white-space: nowrap; }

/* ---------- Anel de percentil ---------- */
.ring { --value: 50; --size: 64px; --color: #34d399; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: conic-gradient(var(--color) calc(var(--value) * 1%), rgba(255, 255, 255, .15) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: rgba(11, 31, 51, .85); }
.ring span { position: relative; font-weight: 800; font-size: .85rem; color: #fff; }
.ring--dark::before { background: #fff; }
.ring--dark { background: conic-gradient(var(--saf-primary) calc(var(--value) * 1%), #e2e8f0 0); }
.ring--dark span { color: var(--saf-ink); }

/* ---------- Modais ---------- */
.modal-content { border: 0; border-radius: 22px; box-shadow: var(--saf-shadow-lg); }
.modal-header { padding: 1rem 1.3rem; border-bottom: 1px solid var(--saf-border); }
.modal-title { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.modal-body { padding: 1.3rem; }
.modal-footer { padding: .85rem 1.3rem; border-top: 1px solid var(--saf-border); }
.modal-backdrop.show { opacity: .55; }
/* Formulários que envolvem header/body/footer mantêm a rolagem apenas no corpo */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden; }
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.98); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.modal.show .modal-dialog { transform: none; }
.modal-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--saf-primary) 14%, #fff); color: var(--saf-primary-700); font-size: 1.05rem; }

.auth-modal__art { background-size: cover; background-position: center; position: relative; min-height: 100%; }
.auth-modal__art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 31, 51, .2), rgba(11, 31, 51, .92)); }
.auth-modal__art-inner { position: absolute; inset: auto 0 0 0; padding: 2rem; color: #fff; }
.auth-modal__art-inner h3 { font-weight: 800; line-height: 1.2; }
.toggle-password { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--saf-muted); }
.icon-bubble { width: 48px; height: 48px; border-radius: 14px; background: var(--saf-gradient); color: #fff; display: grid; place-items: center; font-size: 1.5rem; box-shadow: 0 12px 24px -10px rgba(16, 185, 129, .7); }

.account-type__card { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; border: 2px solid var(--saf-border); border-radius: 16px; cursor: pointer; transition: all .2s; height: 100%; }
.account-type__card i { font-size: 1.6rem; color: var(--saf-muted); }
.account-type__card span { font-size: .82rem; color: var(--saf-muted); }
.btn-check:checked + .account-type__card { border-color: var(--saf-primary); background: color-mix(in srgb, var(--saf-primary) 7%, #fff); box-shadow: 0 8px 20px -12px rgba(16, 185, 129, .8); }
.btn-check:checked + .account-type__card i { color: var(--saf-primary); }

/* ---------- Formulários ---------- */
.form-control, .form-select { border-color: #dbe2ea; padding: .5rem .8rem; }
.form-select { padding-right: 2.2rem; background-position: right .7rem center; }
.form-control:focus, .form-select:focus { border-color: var(--saf-primary); box-shadow: 0 0 0 .22rem rgba(16, 185, 129, .15); }
.form-label { font-weight: 600; font-size: .85rem; color: #334155; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--saf-primary); border-color: var(--saf-primary); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(16, 185, 129, .15); }
.form-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--saf-muted); margin: 1.25rem 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.form-section-title::after { content: ''; flex: 1; height: 1px; background: var(--saf-border); }

.color-swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.color-swatches input { display: none; }
.color-swatches label { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--saf-border); transition: transform .15s; }
.color-swatches input:checked + label { transform: scale(1.15); box-shadow: 0 0 0 2px var(--saf-ink); }

.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state__icon { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 1rem; display: grid; place-items: center; font-size: 2.2rem; color: var(--saf-primary); background: color-mix(in srgb, var(--saf-primary) 12%, #fff); animation: bob 3s ease-in-out infinite; }

/* ---------- Animações ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); } 70% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; display: inline-block; animation: pulse 1.8s infinite; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 50%, #eef2f7 75%); background-size: 800px 100%; animation: shimmer 1.4s infinite linear; border-radius: 12px; }
.fade-up { animation: fadeUp .45s ease both; }

/* SweetAlert */
.swal2-popup { border-radius: 22px !important; font-family: var(--bs-font-sans-serif) !important; }
.swal2-styled.swal2-confirm { background: var(--saf-gradient) !important; border-radius: 999px !important; }
.swal2-styled.swal2-cancel { border-radius: 999px !important; }
.swal2-toast { border-radius: 14px !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
