:root{
  --bg:#f6f7f9;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e5e7eb;

  --primary:#8fb3c9;
  --primary-hover:#7aa6bf;
  --secondary:#c7dedd;

  --shadow:0 20px 40px rgba(0,0,0,.06);
  --radius:18px;
  --topbar-h:64px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:"Segoe UI",system-ui,-apple-system,sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(143,179,201,.18), transparent 60%),
              radial-gradient(900px 500px at 80% 10%, rgba(199,222,221,.22), transparent 55%),
              var(--bg);
  padding-top: var(--topbar-h);
}

/* Topbar */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  z-index:10;
  height: var(--topbar-h);
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 0 18px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.back{
  text-decoration:none;
  color:#2b5f78;
  font-weight:800;
  padding:8px 12px;
  border-radius:999px;
}
.back:hover{ background: var(--secondary); }

.brand{ display:flex; align-items:center; gap:10px; }
.logo{
  width:34px; height:34px;
  border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  font-weight:900; color:#fff; letter-spacing:.5px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 12px 24px rgba(143,179,201,0.28);
}
.name{ font-weight:900; letter-spacing:.4px; }

/* Layout */
.page{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 18px 40px;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero h1{ margin: 0 0 6px; font-size: 1.8rem; }
.muted{ color: var(--muted); }
.small{ font-size:.92rem; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

h2{ margin: 0 0 10px; font-size: 1.25rem; }
h3{ margin: 14px 0 10px; font-size: 1.05rem; }

/* Tabs */
.tabs{
  display:flex;
  gap:10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.tab{
  border:1px solid var(--border);
  background:#f9fafb;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  cursor:pointer;
}
.tab.active{
  background: var(--secondary);
  border-color: var(--secondary);
}

/* Groups */
.group{
  display:grid;
  gap:10px;
}

.item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 12px 12px;
  background: rgba(250,250,250,.8);
}

.left{
  display:flex;
  gap:10px;
  align-items:center;
}
.item input{ width: 18px; height: 18px; }
.title{ font-weight: 900; }
.desc{ font-size: .9rem; color: var(--muted); margin-top: 2px; }
.priceTag{
  font-weight: 900;
  background: rgba(255,255,255,.85);
  border:1px solid var(--border);
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Fields */
.row{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 12px; }
.split{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.field{ display:grid; gap: 8px; }
label{ font-weight: 800; color: #334155; }

input, select, textarea{
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  font: inherit;
  outline:none;
  background: #fbfbfc;
}

input:focus, select:focus, textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(143,179,201,.22);
}

/* Summary */
.summary{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
}
.total{ text-align:right; }
.price{ font-size: 2rem; font-weight: 950; letter-spacing: .3px; }
.divider{ height: 1px; background: var(--border); margin: 14px 0; }

/* Output */
#quoteOutput{
  width:100%;
  min-height: 220px;
  resize: vertical;
  background: #f9fafb;
}

/* Buttons */
.btn{
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--primary);
  color:#fff;
  font-weight: 900;
  cursor:pointer;
}
.btn:hover{ background: var(--primary-hover); }

.btn.ghost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.soft{
  background: #8fd0b0;
  color:#0f172a;
}
.btn.soft:hover{ filter: brightness(.98); }

.copied{
  font-weight: 800;
  color: #2b5f78;
  align-self:center;
}

/* Mobile */
@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .split{ grid-template-columns: 1fr; }
}
