/* QuadroPro — estilos gerais */
:root {
  --navy: #0b1324;
  --navy-2: #131d33;
  --navy-3: #1d2944;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f3f5f9;
  --card: #ffffff;
  --primary: #1d5bff;
  --primary-d: #1448d4;
  --amber: #ffb400;
  --amber-d: #e09e00;
  --green: #12a150;
  --red: #e5383b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
img { max-width: 100%; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: 600 14px/1.2 var(--font); cursor: pointer; background: #fff; color: var(--ink); border-color: var(--line); text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; min-height: 42px; }
.btn:active { transform: translateY(1px); }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-amber { background: var(--amber); color: #1b1300; border-color: var(--amber); }
.btn-amber:hover { background: var(--amber-d); border-color: var(--amber-d); }
.btn-dark { background: var(--navy-3); color: #fff; border-color: #2a3858; }
.btn-dark:hover { background: #26345a; border-color: #34446b; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: #fff1f1; border-color: #fbc7c8; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(15, 23, 42, .06); border-color: transparent; }
.btn-sm { padding: 6px 10px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Formulários ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #334155; }
.input, select.input, textarea.input { width: 100%; border: 1px solid #cfd8e3; background: #fff; border-radius: 10px; padding: 10px 12px; font: 500 15px var(--font); color: var(--ink); min-height: 42px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 91, 255, .15); }
textarea.input { min-height: 90px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .row, .row3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; font-size: 14px; }
.alert-ok { background: #e9f9ef; color: #0b6b34; border: 1px solid #bfe9cf; }
.alert-err { background: #fff0f0; color: #a3191c; border: 1px solid #f7c6c7; }
.alert-warn { background: #fff8e6; color: #7a5300; border: 1px solid #fde3a0; }

/* ---------- Autenticação / landing ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at 10% 0%, #1d2d5a 0%, var(--navy) 60%); color: #e7ecf7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero h1 { font-size: 40px; font-weight: 800; color: #fff; max-width: 520px; }
.auth-hero h1 em { color: var(--amber); font-style: normal; }
.auth-hero p { color: #b8c3dc; font-size: 17px; max-width: 480px; }
.auth-hero ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.auth-hero li { display: flex; gap: 10px; align-items: center; color: #dbe3f3; font-weight: 500; }
.auth-hero li i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 180, 0, .15); color: var(--amber); display: grid; place-items: center; font-style: normal; font-weight: 800; flex: none; }
.auth-hero .preview { margin-top: 28px; max-width: 520px; max-height: 40vh; object-fit: contain; object-position: left top; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .45)); }
.auth-side { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .tabs { display: grid; grid-template-columns: 1fr 1fr; background: #e8edf5; padding: 4px; border-radius: 12px; margin-bottom: 20px; }
.auth-card .tabs a { text-align: center; padding: 9px; border-radius: 9px; font-weight: 700; color: #475569; text-decoration: none; }
.auth-card .tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: inherit; text-decoration: none !important; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--amber); display: grid; place-items: center; }
.brand .logo svg { width: 22px; height: 22px; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 22px; }
  .auth-side { position: static; height: auto; }
  .auth-hero h1 { font-size: 28px; }
  .auth-hero .preview, .auth-hero ul { display: none; }
}

/* ---------- App shell ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
.topbar .in { max-width: 1200px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 14px; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.topbar nav a { color: #c9d3ea; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; text-decoration: none; }
.topbar nav a:hover, .topbar nav a.on { background: rgba(255, 255, 255, .08); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-3); display: grid; place-items: center; font-weight: 800; color: var(--amber); border: 1px solid #2c3b5f; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px 18px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; margin: 0; }
.page-head .sp { flex: 1; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #e8edf4; }
.card-pad { padding: 20px; }
.muted { color: var(--muted); }
@media (max-width: 640px) {
  .topbar nav a span { display: none; }
  .container { padding: 16px 12px 80px; }
}

/* Novo projeto — modelos */
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tpl { border: 2px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tpl:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.tpl .th { height: 110px; border-radius: 10px; background: #eef2f8; display: grid; place-items: center; overflow: hidden; }
.tpl .th svg { max-height: 100px; max-width: 100%; }
.tpl b { font-size: 14px; }
.tpl small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.tag-res { background: #e6f0ff; color: #1448d4; }
.tag-com { background: #fff4d6; color: #8a5a00; }
.tag-ind { background: #ffe8e8; color: #b0191c; }

/* Lista de projetos */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj { overflow: hidden; display: flex; flex-direction: column; }
.proj .th { position: relative; aspect-ratio: 16/10; background: linear-gradient(135deg, #e9eef6, #dfe6f1); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.proj .th img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.proj .bd { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.proj .bd h3 { font-size: 16px; margin: 0; }
.proj .ft { display: flex; gap: 6px; padding: 0 14px 14px; flex-wrap: wrap; }
.status { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.st-rascunho { background: #eef2f7; color: #475569; }
.st-enviado { background: #e6f0ff; color: #1448d4; }
.st-aprovado { background: #e3f8ea; color: #0b7a3a; }
.st-revisao { background: #fff2dc; color: #9a5b00; }
.empty { text-align: center; padding: 50px 20px; }
.empty svg { width: 80px; opacity: .5; }

/* Tabelas */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table-wrap { overflow-x: auto; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 13, 26, .55); backdrop-filter: blur(2px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-bg.on { display: flex; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: pop .18s ease-out; }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-h h2 { font-size: 18px; margin: 0; flex: 1; }
.modal-b { padding: 20px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; flex-wrap: wrap; }
@media (max-width: 980px) { #toasts { top: 64px; bottom: auto; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94vh; }
}

/* Toast */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: pop .2s; display: flex; gap: 8px; align-items: center; }
.toast.err { background: #b3191c; }
.toast.ok::before { content: "✓"; color: #5fe39a; font-weight: 900; }

/* Install */
.install { max-width: 720px; margin: 30px auto; padding: 0 16px 60px; }
.install .card { padding: 26px; }
.req { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-weight: 500; }
.req b.ok { color: var(--green); }
.req b.no { color: var(--red); }
.step-title { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 16px; margin: 22px 0 12px; }
.step-title span { width: 26px; height: 26px; border-radius: 8px; background: var(--navy); color: var(--amber); display: grid; place-items: center; font-size: 13px; }
.seg { display: inline-flex; background: #e8edf5; padding: 4px; border-radius: 12px; gap: 4px; }
.seg label { padding: 8px 14px; border-radius: 9px; font-weight: 700; cursor: pointer; color: #475569; margin: 0; }
.seg input { display: none; }
.seg input:checked + label { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* Public view */
.pub-head { background: var(--navy); color: #fff; padding: 18px; }
.pub-head .in { max-width: 1100px; margin: 0 auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pub-logo { height: 44px; background: #fff; border-radius: 8px; padding: 4px; }
.approve-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; box-shadow: 0 -6px 20px rgba(0, 0, 0, .06); z-index: 20; }
