/* Iron Decor — cores da IronGatte: preto, dourado e branco. */
:root {
  --preto: #0E0E0E;
  --preto2: #1B1B1B;
  --preto3: #2A2A2A;
  --ouro: #F5B800;
  --ouro2: #D9A300;
  --ouro-claro: #FFF4CC;
  --creme: #F7F4EE;
  --branco: #FFFFFF;
  --texto: #1C1C1C;
  --cinza: #6E6A63;
  --linha: #E4DED2;
  --verde: #2E7D32;
  --vermelho: #C62828;
  --raio: 14px;
  --sombra: 0 6px 24px rgba(0, 0, 0, .10);
  --topo: 56px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--creme); color: var(--texto); font-size: 16px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
h1 { font-family: "Playfair Display", Georgia, serif; font-size: 1.55rem; margin: 0; font-weight: 700; }
h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; }
.nota { color: var(--cinza); font-size: .92rem; margin: .4rem 0 1rem; }

/* Marca */
.marca { display: flex; align-items: center; gap: 8px; font-family: "Playfair Display", Georgia, serif; font-size: 1.2rem; color: #fff; letter-spacing: .3px; white-space: nowrap; }
.marca b { color: var(--ouro); font-weight: 700; }
.marca-simbolo { width: 28px; height: 28px; border-radius: 8px; background: url(icons/icon-192.png) center/cover; flex: none; }
.marca.grande { font-size: 2.1rem; justify-content: center; }
.marca.grande .marca-simbolo { width: 52px; height: 52px; border-radius: 14px; }

/* Botões */
.btn { border: 1.5px solid var(--preto); background: var(--branco); border-radius: 999px; padding: .62rem 1.1rem; font-weight: 600; white-space: nowrap; }
.btn.ouro { background: var(--ouro); border-color: var(--ouro); color: var(--preto); }
.btn.ouro:active { background: var(--ouro2); }
.btn.preto { background: var(--preto); color: #fff; }
.btn.perigo { border-color: var(--vermelho); color: var(--vermelho); }
.btn.link { border: 0; background: none; text-decoration: underline; padding: .4rem; color: inherit; }
.btn.largo { width: 100%; }
.btn.peq { padding: .35rem .75rem; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: default; }
.ico { border: 0; background: none; font-size: 1.5rem; width: 42px; height: 42px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; }
.ico:disabled { opacity: .3; }
.chip { border: 1px solid #3a3a3a; background: var(--preto2); color: #fff; border-radius: 999px; padding: .3rem .75rem; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.chip .raio { color: var(--ouro); }

/* Formulários */
label { display: block; font-size: .9rem; font-weight: 600; margin: .7rem 0 .25rem; }
label input, label select, label textarea { display: block; width: 100%; margin-top: .3rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], select, textarea {
  border: 1.5px solid var(--linha); border-radius: 10px; padding: .65rem .75rem; background: #fff; color: var(--texto); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ouro); border-color: var(--ouro); }
.linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linha-botoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }
.linha-botoes .btn { flex: 1 1 auto; }

/* Entrar */
.vista.escura { background: radial-gradient(circle at 50% 0%, #2a2410 0%, var(--preto) 55%); color: #fff; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-caixa { width: 100%; max-width: 380px; }
.slogan { text-align: center; color: #cfc8b6; margin: .6rem 0 1.6rem; }
.login-caixa label { color: #ddd; }
.login-caixa input { background: #161616; border-color: #333; color: #fff; }
.login-caixa .btn.link { color: #cfc8b6; display: block; margin: .6rem auto 0; }
.convite { text-align: center; color: #8d877a; font-size: .85rem; margin-top: 2rem; }

/* Topo */
#topo { position: sticky; top: 0; z-index: 20; height: var(--topo); background: var(--preto); color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; padding-top: env(safe-area-inset-top); }
#topo .ico { color: #fff; }
.espaco { flex: 1; }

/* Menu */
#menu { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); }
.menu-caixa { position: absolute; right: 0; top: 0; bottom: 0; width: min(300px, 86vw); background: var(--preto); color: #fff; padding: 22px 18px; display: flex; flex-direction: column; gap: 4px; }
.menu-caixa button { text-align: left; background: none; border: 0; padding: .85rem .6rem; border-radius: 10px; font-size: 1.02rem; }
.menu-caixa button:hover { background: var(--preto2); }
.menu-quem { padding: 0 .6rem 1rem; border-bottom: 1px solid #2c2c2c; margin-bottom: .6rem; display: flex; flex-direction: column; }
.menu-quem b { color: var(--ouro); }
.menu-quem span { color: #aaa; font-size: .85rem; word-break: break-all; }
.versao { margin-top: auto; color: #666; font-size: .8rem; padding: 0 .6rem; }

/* Páginas */
.vista:not(.escura):not(.editor) { max-width: 920px; margin: 0 auto; padding: 18px 16px 90px; }
.cabeca { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cartao { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; border: 0; padding: 0; text-align: left; display: flex; flex-direction: column; }
.cartao .mini { aspect-ratio: 3/4; background: #ece7dc center/cover no-repeat; }
.cartao .info { padding: 10px 12px 12px; }
.cartao .info b { display: block; font-size: .98rem; }
.cartao .info span { color: var(--cinza); font-size: .82rem; }
.vazio { text-align: center; color: var(--cinza); padding: 40px 10px; grid-column: 1/-1; }
.vazio b { display: block; color: var(--texto); font-size: 1.1rem; margin-bottom: .4rem; }

/* Editor */
.vista.editor { position: fixed; inset: 0; z-index: 30; background: #262626; display: flex; flex-direction: column; color: #fff; }
.ed-topo { height: 52px; background: var(--preto); display: flex; align-items: center; gap: 4px; padding: 0 6px; padding-top: env(safe-area-inset-top); flex: none; }
.ed-topo .ico { color: #fff; }
.ed-nome { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; font-weight: 700; font-size: 1rem; padding: .4rem; border-radius: 8px; }
.ed-nome:focus { outline: 1px solid var(--ouro); background: #1a1a1a; }
.status { font-size: .75rem; color: #9b9b9b; white-space: nowrap; }
#palco-area { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; overflow: hidden; }
#palco { box-shadow: 0 8px 40px rgba(0, 0, 0, .55); background: #fff; line-height: 0; }
.vazio-dica { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(14, 14, 14, .8); padding: .7rem 1rem; border-radius: 12px; pointer-events: none; text-align: center; }
.vazio-dica b { color: var(--ouro); }
.ed-sel { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; background: #1b1b1b; border-top: 1px solid #333; flex: none; }
.ed-sel button { background: #2c2c2c; border: 1px solid #3a3a3a; border-radius: 10px; padding: .45rem .7rem; color: #fff; white-space: nowrap; font-size: .9rem; }
.ed-sel button.perigo { color: #ff8a80; }
.ed-barra { display: flex; justify-content: space-around; background: var(--preto); padding: 6px 4px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); flex: none; }
.ed-barra button { background: none; border: 0; color: #ddd; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; padding: 4px 6px; border-radius: 10px; min-width: 56px; }
.ed-barra button svg { width: 24px; height: 24px; }
.ed-barra button.destaque { color: var(--preto); background: var(--ouro); font-weight: 700; }

/* Folhas (sobem de baixo) e janelas */
.folha-fundo, .modal-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
.folha-fundo.aberta, .modal-fundo.aberta { opacity: 1; }
.folha { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #fff; color: var(--texto); border-radius: 18px 18px 0 0; max-height: 62vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .22s ease-out; box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); max-width: 760px; margin: 0 auto; }
.folha.alta { max-height: 88vh; }
.folha.aberta { transform: translateY(0); }
.folha-topo, .modal-topo { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 18px; flex: none; }
.folha-topo b, .modal-topo b { font-size: 1.05rem; }
.folha-topo .ico, .modal-topo .ico { font-size: 1.1rem; color: var(--cinza); }
.folha-corpo, .modal-corpo { overflow-y: auto; padding: 4px 16px 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.modal { position: fixed; z-index: 52; left: 50%; top: 50%; transform: translate(-50%, -48%); opacity: 0; transition: all .2s; width: min(560px, 94vw); max-height: 92vh; background: #fff; color: var(--texto); border-radius: 18px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.modal.aberta { opacity: 1; transform: translate(-50%, -50%); }

.abas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.abas button { border: 1.5px solid var(--linha); background: #fff; border-radius: 999px; padding: .38rem .8rem; white-space: nowrap; font-size: .88rem; }
.abas button.ativa { background: var(--preto); color: #fff; border-color: var(--preto); }
.catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.catalogo button { border: 1.5px solid var(--linha); background: #faf8f3; border-radius: 12px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; text-align: center; }
.catalogo button img { width: 72px; height: 72px; object-fit: contain; }
.catalogo button:active { border-color: var(--ouro); }
.paleta { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.paleta .cor { aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .12); }
.paleta .cor.marcada { outline: 3px solid var(--ouro); outline-offset: 2px; }
.cor-livre { display: flex; align-items: center; gap: 10px; }
.cor-livre input { width: 54px; height: 40px; padding: 0; border: 0; display: inline-block; margin: 0; }
.fontes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fontes button { border: 1.5px solid var(--linha); background: #fff; border-radius: 12px; padding: .6rem .3rem; font-size: 1.2rem; }
.fontes button.ativa { border-color: var(--ouro); background: var(--ouro-claro); }
.alternar { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: .8rem 0; }
.alternar input { width: 22px; height: 22px; }

/* Antes e depois */
.comparar { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; background: #eee; user-select: none; touch-action: none; }
.comparar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.comparar .antes { clip-path: inset(0 calc(100% - var(--corte, 50%)) 0 0); }
.comparar .divisa { position: absolute; top: 0; bottom: 0; left: var(--corte, 50%); width: 3px; background: var(--ouro); transform: translateX(-50%); pointer-events: none; }
.comparar .divisa::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--ouro); color: var(--preto); font-weight: 700; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.comparar input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: ew-resize; }
.comparar .rot { position: absolute; bottom: 10px; background: rgba(14, 14, 14, .75); color: #fff; font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; pointer-events: none; }
.comparar .rot-a { left: 10px; } .comparar .rot-d { right: 10px; }

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.galeria figure { margin: 0; background: #f3efe6; border-radius: 10px; overflow: hidden; }
.galeria img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.galeria figcaption { display: flex; gap: 4px; padding: 6px; flex-wrap: wrap; }
.galeria figcaption .btn { flex: 1; padding: .3rem .4rem; font-size: .78rem; }

/* Orçamento */
.bloco { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: 14px 16px 16px; margin-bottom: 14px; }
.bloco > h2:first-child { margin-top: 0; }
.itens .item { border-bottom: 1px solid var(--linha); padding: 10px 0; }
.itens .item:first-child { padding-top: 2px; }
.item-desc { display: flex; gap: 6px; align-items: center; }
.item-desc input { flex: 1; font-weight: 600; }
.item-desc .x { border: 0; background: none; color: var(--vermelho); font-size: 1.4rem; width: 36px; flex: none; }
.item-nums { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: end; margin-top: 6px; }
.item-nums label { margin: 0; font-size: .74rem; color: var(--cinza); font-weight: 600; }
.item-nums input { margin-top: 2px; padding: .5rem .6rem; }
.item-total { text-align: right; min-width: 96px; padding-bottom: .55rem; }
.item-total small { display: block; font-size: .74rem; color: var(--cinza); font-weight: 600; }
.item-total b { font-size: 1.02rem; white-space: nowrap; }
.totais { margin-top: 10px; display: grid; gap: 4px; justify-content: end; text-align: right; }
.totais .total { font-size: 1.25rem; font-weight: 800; background: var(--ouro-claro); border: 1.5px solid var(--ouro); padding: .3rem .7rem; border-radius: 10px; }
.fotos-escolha { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.fotos-escolha button { border: 3px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; background: #eee; flex: none; width: 90px; }
.fotos-escolha button.ativa { border-color: var(--ouro); }
.fotos-escolha img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.fotos-escolha span { display: block; font-size: .72rem; padding: 2px; text-align: center; }

/* Peças do acervo */
.grade.pecas .mini { aspect-ratio: 1; background-size: contain; background-color: #fff;
  background-image: linear-gradient(45deg, #f1ede4 25%, transparent 25%), linear-gradient(-45deg, #f1ede4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f1ede4 75%), linear-gradient(-45deg, transparent 75%, #f1ede4 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; position: relative; }
.grade.pecas .mini img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.xadrez { background-color: #fff; background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; border-radius: 12px; }
.previa { width: 100%; max-height: 42vh; object-fit: contain; display: block; }

/* Parceiras */
.parceira { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.parceira .dados span { display: block; color: var(--cinza); font-size: .85rem; }
.parceira .saldo { font-size: 1.4rem; font-weight: 800; text-align: right; }
.parceira .saldo small { display: block; font-size: .72rem; color: var(--cinza); font-weight: 600; }
.parceira .acoes { grid-column: 1/-1; display: flex; gap: 6px; flex-wrap: wrap; }
.resumo-uso { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.resumo-uso div { background: var(--preto); color: #fff; border-radius: 12px; padding: 10px 14px; }
.resumo-uso b { color: var(--ouro); font-size: 1.2rem; display: block; }
.credenciais { background: var(--ouro-claro); border: 1.5px solid var(--ouro); border-radius: 12px; padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; word-break: break-all; }

/* Aviso e espera */
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--preto); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; z-index: 80; opacity: 0; transition: all .25s; pointer-events: none; max-width: 90vw; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
#toast.ver { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.erro { background: var(--vermelho); }
#carregando { position: fixed; inset: 0; z-index: 90; background: rgba(10, 10, 10, .72); display: grid; place-content: center; justify-items: center; color: #fff; text-align: center; padding: 20px; }
#carregando p { max-width: 320px; margin-top: 16px; }
.roda { width: 46px; height: 46px; border: 4px solid rgba(255, 255, 255, .2); border-top-color: var(--ouro); border-radius: 50%; animation: gira .9s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
