/* styles.css */

:root{
  --bg:#0f172a;
  --bg2:#0b1220;

  --card:#1e293b;
  --card2:#111827;

  --text:#ffffff;
  --muted:#94a3b8;
  --muted2:#64748b;

  --line:#334155;
  --accent:#38bdf8;

  --radius:14px;
  --radius-sm:10px;
  --shadow: 0 18px 50px rgba(0,0,0,0.35);
}

*{ box-sizing:border-box; }

body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica,Arial;
  margin:0;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 50% -120px, rgba(56,189,248,0.14), transparent 60%),
    radial-gradient(900px 500px at 110% 20%, rgba(56,189,248,0.08), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  text-align:center;
}

a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.hidden{ display:none; }

/* -----------------------------
   Layout
-------------------------------- */
.container{
  max-width:980px;
  margin:0 auto;
  padding:48px 20px 70px;
}

/* optional tool page wrapper */
.page{
  min-height:100svh;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}
.page .container{ width:100%; }

/* Slightly better spacing on very wide screens */
@media (min-width:1100px){
  .container{ max-width:1040px; }
}

/* -----------------------------
   Typography
-------------------------------- */
h1{
  font-size:44px;
  letter-spacing:-0.02em;
  margin:0 0 10px;
}

.subtitle{
  color:var(--muted);
  margin:0 0 26px;
  font-size:16px;
  line-height:1.45;
}

/* Utility text helpers */
.hint{
  color:var(--muted2);
  font-size:12px;
  margin-left:6px;
}

.breakdown{
  margin-top:10px;
  font-size:13px;
  line-height:1.5;
}

.note{
  margin-top:12px;
  font-size:12px;
  line-height:1.4;
}

/* Related calculators block helper */
.related{
  font-size:13px;
  line-height:1.6;
}

/* -----------------------------
   Cards / Panels
-------------------------------- */
.card, .panel{
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border:1px solid rgba(255,255,255,0.10);
  border-radius:var(--radius);
  padding:20px;
  text-align:left;
  box-shadow: var(--shadow);
}

/* glass polish (safe fallback) */
.card{ backdrop-filter: blur(6px); }
@supports not ((backdrop-filter: blur(6px))){
  .card{ background: rgba(30,41,59,0.70); }
}

/* -----------------------------
   Grid
-------------------------------- */
.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
  margin-top:20px;
}
@media (min-width:900px){
  .grid{ grid-template-columns:1fr 1fr; }
}

/* -----------------------------
   Tool tiles
-------------------------------- */
.toolList{
  margin-top:14px;
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.tool{
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.10);
  padding:14px 14px;
  border-radius:12px;
  transition:0.18s ease;
  cursor:pointer;
  user-select:none;
}

.tool:hover{
  background:rgba(255,255,255,0.06);
  border-color: rgba(56,189,248,0.22);
  transform: translateY(-1px);
}

.tool:active{ transform: translateY(0px); }

.tool small{
  display:block;
  color:var(--muted);
  margin-top:4px;
}

/* Disabled tool state */
.tool.disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none !important;
}
.tool.disabled:hover{
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.10);
}

/* Badge */
.badge{
  display:inline-block;
  font-size:12px;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,0.35);
  color:var(--accent);
  background: rgba(56,189,248,0.08);
  margin-left:8px;
  vertical-align:middle;
}

/* -----------------------------
   Header helpers
-------------------------------- */
.titleRow{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

.backlink{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-weight:600;
  text-decoration:none;
  border:1px solid rgba(255,255,255,0.10);
  padding:8px 12px;
  border-radius:999px;
  background: rgba(255,255,255,0.03);
}
.backlink:hover{
  color:var(--text);
  border-color: rgba(56,189,248,0.25);
  text-decoration:none;
}

/* Shared tool-page sizing (optional helpers) */
.pageHead{
  max-width:920px;
  margin:0 auto 18px;
}
.toolPageCard{
  max-width:920px;
  margin:0 auto;
}

/* -----------------------------
   Forms
-------------------------------- */
.row{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  margin-top:12px;
}
@media (min-width:640px){
  .row{ grid-template-columns:1fr 1fr; }
}

label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin:0 0 6px;
}

input, select{
  width:100%;
  padding:12px 12px;
  border-radius:var(--radius-sm);
  border:1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.05)), var(--card2);
  color:var(--text);
  outline:none;
  height:44px;
}

input:focus, select:focus{
  border-color: rgba(56,189,248,0.7);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.18);
}

/* -----------------------------
   Actions / Buttons
-------------------------------- */
.actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}

button{
  padding:12px 16px;
  border-radius:var(--radius-sm);
  border:1px solid rgba(255,255,255,0.16);
  background: rgba(56,189,248,0.14);
  color:var(--text);
  cursor:pointer;
  transition:0.18s ease;
  font-weight:700;
  min-height:44px;
  letter-spacing:0.2px;
}

button:hover{
  background: rgba(56,189,248,0.22);
  border-color: rgba(56,189,248,0.35);
}

button:active{ transform: translateY(1px); }

.secondary{
  background: rgba(255,255,255,0.06);
}
.secondary:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
}

/* -----------------------------
   Results
-------------------------------- */
.results{
  margin-top:14px;
  padding:14px;
  border-radius:12px;
  border:1px dashed rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.02);
  color:var(--text);
}

.results .muted{
  color:var(--muted);
  font-size:13px;
  margin-top:4px;
}

.kpi{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:10px;
}
@media (min-width:640px){
  .kpi{ grid-template-columns:1fr 1fr; }
}

.kpiBox{
  background: rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  padding:12px;
}

.kpiBox .label{
  color:var(--muted);
  font-size:12px;
}

.kpiBox .value{
  font-size:24px;
  font-weight:800;
  margin-top:4px;
  letter-spacing:-0.3px;
}

/* -----------------------------
   Footer
-------------------------------- */
.footer{
  margin-top:40px;
  color:var(--muted2);
  font-size:14px;
  text-align:center;
}

/* -----------------------------
   Reduced motion
-------------------------------- */
@media (prefers-reduced-motion: reduce){
  .tool, button{ transition:none; }
  .tool:hover{ transform:none; }
}
