/*
Theme Name: Solar Vitor Meirelles
Description: Tema mobile-first para portal de condomínio: área pública, área do morador e painel do síndico.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: svm
*/

:root {
	--navy: #0b3a6e;
	--navy-d: #072a52;
	--green: #2e9a47;
	--green-d: #16743a;
	--green-l: #e6f6ea;
	--indigo: #4f46e5;
	--indigo-l: #eef0ff;
	--orange: #f59e0b;
	--orange-d: #b45309;
	--orange-l: #fff3d6;
	--sky-d: #0369a1;
	--sky-l: #e0f2fe;
	--red: #dc2626;
	--red-l: #fde8e8;
	--bg: #f2f5f9;
	--card: #fff;
	--text: #0f1b2d;
	--muted: #5b6678;
	--line: #e6eaf0;
	--r: 18px;
	--shadow: 0 6px 18px rgba(15, 27, 45, .07);
	--tabbar: 66px;
	--font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #dde5ef; color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 3px solid rgba(79, 70, 229, .5); outline-offset: 2px; border-radius: 6px; }

/* ---------- App shell (sempre em largura de celular) ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); position: relative; overflow-x: clip; }
@media (min-width: 520px) { .app { box-shadow: 0 0 80px rgba(11, 58, 110, .18); } }
.main { padding-bottom: 32px; }
.has-tabbar .main { padding-bottom: calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); }
.container { padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.icon { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-indigo { color: var(--indigo); }
.c-green { color: var(--green); }
.c-orange { color: var(--orange); }
.c-indigo, .c-green, .c-orange { display: inline-flex; }

.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; color: inherit; border-radius: 12px; cursor: pointer; flex: none; padding: 0; }
.icon-btn:active { background: rgba(255, 255, 255, .15); }
.icon-btn .icon { width: 26px; height: 26px; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand__logo { width: 46px; height: 46px; flex: none; }
.brand__name { font-weight: 700; font-size: 19px; line-height: 1.1; }
.brand__name > span { display: block; }
.brand__tag { font-size: 13px !important; letter-spacing: .2em; font-weight: 500; opacity: .9; margin-top: 3px; }

.avatar { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; flex: none; overflow: hidden; }
.avatar .icon { width: 28px; height: 28px; margin-top: 6px; }
.avatar--sm { width: 36px; height: 36px; margin-right: 4px; }
.avatar--sm .icon { width: 22px; height: 22px; margin-top: 4px; }

/* ---------- Hero (tela pública) ---------- */
.hero { position: relative; color: #fff; min-height: 500px; padding: calc(14px + env(safe-area-inset-top)) 18px 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; isolation: isolate;
	background:
		linear-gradient(180deg, rgba(7, 42, 82, .6) 0%, rgba(7, 42, 82, .12) 34%, rgba(5, 24, 46, .55) 62%, rgba(5, 24, 46, .85) 100%),
		var(--hero) center 30% / cover no-repeat, var(--navy); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; background: linear-gradient(180deg, rgba(242, 245, 249, 0), var(--bg)); z-index: -1; }
.hero__top { display: flex; justify-content: space-between; align-items: flex-start; }
.hero__text h1 { font-size: 28px; font-weight: 800; margin: 0 0 8px; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.hero__text p { margin: 0; font-size: 16px; opacity: .95; max-width: 34ch; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.overlap { position: relative; z-index: 2; margin-top: -84px; }
.overlap-sm { position: relative; z-index: 2; margin-top: -30px; }

/* ---------- Header morador ---------- */
.apphead { position: relative; color: #fff; background: linear-gradient(160deg, #0b3a6e 0%, #0b4566 52%, #11704e 100%); padding: calc(14px + env(safe-area-inset-top)) 18px 66px; overflow: hidden; }
.apphead__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.apphead__hello { position: relative; z-index: 1; }
.apphead__hello h1 { margin: 22px 0 2px; font-size: 27px; font-weight: 800; }
.apphead__hello p { margin: 0; opacity: .9; font-size: 17px; }
.apphead__wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 90px; }

/* ---------- Header gestão ---------- */
.gesthead { background: var(--navy); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 18px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gesthead__actions { display: flex; align-items: center; gap: 6px; }
.bell { position: relative; }
.bell.has-dot::after { content: ""; position: absolute; top: 8px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; border: 2px solid var(--navy); }

/* ---------- Header páginas internas ---------- */
.pagehead { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 4px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; min-height: 60px; box-shadow: 0 4px 14px rgba(7, 42, 82, .2); }
.pagehead h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Login ---------- */
.loginhead { position: relative; color: #fff; text-align: center; padding: calc(16px + env(safe-area-inset-top)) 20px 110px; background: linear-gradient(160deg, #0b3a6e 0%, #0b4566 55%, #11704e 100%); display: flex; flex-direction: column; align-items: center; }
.loginhead__back { position: absolute; left: 8px; top: calc(10px + env(safe-area-inset-top)); }
.loginhead .brand { margin-top: 36px; text-align: left; }
.loginhead h1 { margin: 28px 0 6px; font-size: 26px; font-weight: 800; }
.loginhead p { margin: 0; opacity: .9; max-width: 30ch; }
.link-center { display: block; text-align: center; margin-top: 14px; color: var(--navy); font-weight: 600; font-size: 15px; }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin: 18px 8px; }
.hint a { color: var(--navy); font-weight: 600; text-decoration: underline; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.feature { display: flex; align-items: center; gap: 14px; padding: 18px 14px 18px 18px; transition: transform .15s; }
.feature:active, .tile:active, .action:active, .item:active { transform: scale(.98); }
.feature__icon { color: var(--green); align-self: flex-start; padding-top: 2px; }
.feature__icon .icon { width: 32px; height: 32px; }
.feature__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.eyebrow { display: block; font-size: 13px; font-weight: 600; color: var(--green-d); }
.feature__title { font-size: 18px; font-weight: 700; }
.feature__meta { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; font-size: 15px; }
.feature__meta span { display: flex; align-items: center; gap: 8px; }
.feature__meta .icon { width: 16px; height: 16px; color: var(--text); }
.feature__text { font-size: 14px; color: var(--muted); }
.feature__chev { color: var(--text); width: 26px; height: 26px; }

/* ---------- Atalhos ---------- */
.tiles { display: grid; gap: 12px; margin: 16px 0; }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.tiles--2 { grid-template-columns: repeat(2, 1fr); }
.tile { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 6px; min-height: 108px; text-align: center; font-weight: 600; font-size: 14px; line-height: 1.2; transition: transform .15s; }
.tile .icon { width: 36px; height: 36px; stroke-width: 1.8; }
.tiles--2 .tile { min-height: 100px; font-size: 16px; }
@media (max-width: 340px) { .tiles--3 { grid-template-columns: repeat(2, 1fr); } }
.login-cta { margin-top: 24px; }

/* ---------- Gestão ---------- */
.page-title { font-size: 26px; font-weight: 800; margin: 24px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 18px; font-size: 17px; }
.section-title { font-size: 20px; font-weight: 800; margin: 26px 0 12px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); min-height: 130px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.2; transition: transform .15s; }
.action .icon { width: 42px; height: 42px; stroke-width: 1.8; }

.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 2px 16px; }
.list__row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); min-height: 58px; }
.list__row:last-child { border-bottom: 0; }
.list__label { flex: 1; min-width: 0; font-size: 16px; }
.list__label small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.list__chev { width: 20px; height: 20px; color: var(--text); }

.badge, .pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 700; white-space: nowrap; flex: none; }
.badge { min-width: 32px; height: 30px; padding: 0 10px; font-size: 15px; }
.pill { padding: 4px 10px; font-size: 12px; }
.badge--green, .pill--green { background: var(--green-l); color: var(--green-d); }
.badge--orange, .pill--orange { background: var(--orange-l); color: var(--orange-d); }
.badge--sky, .pill--sky { background: var(--sky-l); color: var(--sky-d); }
.pill--red { background: var(--red-l); color: var(--red); }

/* ---------- Listas de conteúdo ---------- */
.stack { display: grid; gap: 12px; margin: 16px 0; }
.item { display: flex; gap: 14px; align-items: center; padding: 16px; transition: transform .15s; }
.item--col { flex-direction: column; align-items: stretch; gap: 8px; }
.item--col p { margin: 0; color: var(--muted); font-size: 14px; }
.item__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.item__date { flex: none; width: 54px; text-align: center; background: var(--indigo-l); color: var(--indigo); border-radius: 12px; padding: 7px 0; font-weight: 800; font-size: 20px; line-height: 1.05; align-self: flex-start; }
.item__date small { display: block; font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.item__date--green { background: var(--green-l); color: var(--green-d); }
.item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item__title { display: block; font-weight: 700; font-size: 16px; margin: 0; }
.item__meta { display: block; color: var(--muted); font-size: 13px; }
.item__text { color: var(--muted); font-size: 14px; }
.item__chev { width: 20px; height: 20px; color: var(--muted); }
.item.is-past { opacity: .6; }
.tag { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: var(--green-l); color: var(--green-d); }
.reply { background: var(--indigo-l); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.reply strong { display: block; font-size: 11px; color: var(--indigo); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }

.article { padding: 20px; margin: 16px 0; }
.article__title { font-size: 23px; font-weight: 800; margin: 6px 0 12px; }
.article__img { margin: 16px -20px; }
.article__img img { width: 100%; }
.infolist { list-style: none; padding: 12px 14px; margin: 0 0 16px; display: grid; gap: 8px; background: var(--bg); border-radius: 12px; }
.infolist li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.infolist .icon { width: 18px; height: 18px; color: var(--green); }
.prose { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose a { color: var(--indigo); text-decoration: underline; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .icon { width: 46px; height: 46px; opacity: .45; }
.empty p { margin: 10px 0 16px; }

.pagination .nav-links { display: flex; gap: 6px; justify-content: center; }
.page-numbers { min-width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; }
.page-numbers.current { background: var(--navy); color: #fff; }

/* ---------- Formulários ---------- */
.form { padding: 20px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input:not([type]), select, textarea {
	width: 100%; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); appearance: none; min-height: 48px;
}
select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6678' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat; padding-right: 40px; }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 58, 110, .12); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 4px 0 18px; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.file { display: flex; align-items: center; gap: 10px; border: 1.5px dashed #c6cfdb; border-radius: 12px; padding: 16px; color: var(--muted); font-weight: 600; cursor: pointer; overflow: hidden; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; background: var(--line); color: var(--text); min-height: 48px; text-align: center; transition: transform .15s, filter .15s; }
.btn:active { transform: scale(.98); filter: brightness(.95); }
.btn .icon { width: 20px; height: 20px; }
.btn--primary { background: var(--navy); color: #fff; box-shadow: 0 8px 18px rgba(11, 58, 110, .25); }
.btn--green { background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(46, 154, 71, .25); }
.btn--ghost { background: var(--card); border: 1.5px solid var(--line); }
.btn--danger { color: var(--red); }
.btn--block { width: 100%; }
.btn--lg { min-height: 58px; font-size: 17px; }
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }

.flash { padding: 12px 14px; border-radius: 12px; margin: 16px 0; font-weight: 600; font-size: 14px; }
.flash--ok { background: var(--green-l); color: var(--green-d); }
.flash--err { background: var(--red-l); color: var(--red); }

.seg { display: flex; background: #e3e9f1; border-radius: 12px; padding: 4px; gap: 4px; margin: 16px 0; }
.seg a { flex: 1; text-align: center; padding: 10px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg a.is-active { background: #fff; color: var(--navy); box-shadow: 0 2px 6px rgba(15, 27, 45, .08); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.newreq { margin: 16px 0; background: transparent; box-shadow: none; }
.newreq[open] { background: var(--card); box-shadow: var(--shadow); }
.newreq[open] > summary { border-radius: var(--r) var(--r) 0 0; }
.req > summary { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 16px; }
.req__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.req__main .muted { font-size: 13px; }
.req__body { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.req__body .prose { margin-bottom: 14px; font-size: 15px; }
.subdetails { margin: 4px 0 16px; }
.subdetails > summary { font-weight: 600; color: var(--navy); padding: 6px 0 12px; }

.faq { display: grid; gap: 10px; margin: 16px 0; }
.faq summary { padding: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary .icon { width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq__a { padding: 0 16px 16px; color: var(--muted); font-size: 15px; }
.faq details:target { box-shadow: 0 0 0 2px var(--indigo); }

/* ---------- Perfil ---------- */
.profile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 0 18px; text-align: center; }
.profile__avatar { width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(140deg, var(--navy), var(--green)); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.profile strong { font-size: 20px; }

/* ---------- Boletos ---------- */
.boleto { padding: 18px; }
.boleto__valor { display: block; font-size: 24px; font-weight: 800; margin: 2px 0; }
.boleto__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.boleto__actions .btn { flex: 1; }

/* ---------- Calendário ---------- */
.cal { padding: 12px; margin: 16px 0; }
.cal__head { display: flex; align-items: center; justify-content: space-between; color: var(--navy); }
.cal__head strong { font-size: 17px; color: var(--text); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; margin-top: 6px; }
.cal__dow { font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 0; }
.cal__day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; font-size: 15px; position: relative; font-variant-numeric: tabular-nums; }
.cal__day.has-ev { font-weight: 700; color: var(--green-d); background: var(--green-l); }
.cal__day.has-ev::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.cal__day.is-today { background: var(--navy); color: #fff; font-weight: 700; }
.cal__day.is-today::after { background: #fff; }

/* ---------- Barra inferior ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); z-index: 30; box-shadow: 0 -6px 20px rgba(15, 27, 45, .06); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar); font-size: 12px; font-weight: 600; color: var(--muted); position: relative; }
.tabbar a.is-active { color: var(--green); }
.tabbar a.is-active::after { content: ""; position: absolute; bottom: 4px; width: 52px; height: 3px; border-radius: 3px; background: var(--green); }
.tabbar a.is-active .icon { fill: currentColor; fill-opacity: .15; }

/* ---------- Menu lateral ---------- */
.drawer { position: fixed; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 50; pointer-events: none; overflow: hidden; }
.drawer__bg { position: absolute; inset: 0; background: rgba(5, 20, 40, .5); opacity: 0; transition: opacity .2s; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(84%, 340px); background: #fff; transform: translateX(100%); transition: transform .25s ease; padding: calc(10px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; color: var(--navy); font-size: 17px; }
.drawer__nav { display: flex; flex-direction: column; flex: 1; }
.drawer__nav a { display: flex; gap: 14px; align-items: center; padding: 14px 6px; border-bottom: 1px solid var(--line); font-weight: 600; }
.drawer-open { overflow: hidden; }
.drawer-open .drawer { pointer-events: auto; }
.drawer-open .drawer__bg { opacity: 1; }
.drawer-open .drawer__panel { transform: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
