/* shared.css – used by all tool pages */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --border: #e2e0da;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-dark: #1d4ed8;
  --text: #111110;
  --muted: #6b6a66;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --success: #16a34a;
  --success-light: #f0fdf4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* NAV */
nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 900px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--text); text-decoration: none; letter-spacing: -0.5px; flex-shrink: 0; }
.logo span { color: var(--accent); }
.back-btn { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500; color: var(--muted); text-decoration: none; padding: 7px 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--bg); transition: border-color .15s, color .15s; white-space: nowrap; }
.back-btn:hover { border-color: var(--accent); color: var(--accent); }

/* MAIN LAYOUT */
.tool-page { max-width: 900px; margin: 0 auto; padding: 40px 24px 80px; }
.tool-header { margin-bottom: 32px; }
.tool-header .icon { font-size: 2rem; margin-bottom: 12px; display: block; }
.tool-header h1 { font-family: 'Syne', sans-serif; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 8px; }
.tool-header p { color: var(--muted); font-size: .95rem; font-weight: 300; }

/* UPLOAD ZONE */
.upload-zone { background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius); padding: 56px 24px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-light); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-zone h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.upload-zone p { color: var(--muted); font-size: .85rem; }
.upload-zone .browse { color: var(--accent); font-weight: 500; }

/* CONTROLS */
.controls { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-top: 16px; box-shadow: var(--shadow); }
.controls h3 { font-family: 'Syne', sans-serif; font-size: .85rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 8px; }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.field input[type=number] { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: .9rem; color: var(--text); outline: none; transition: border-color .15s; }
.field input[type=number]:focus { border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.val { font-weight: 700; color: var(--accent); }

/* BUTTON */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; font-family: 'DM Sans', sans-serif; font-size: .95rem; font-weight: 600; border: none; border-radius: 99px; padding: 13px 28px; cursor: pointer; transition: background .15s, transform .1s; width: 100%; margin-top: 20px; }
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* RESULT */
.result { background: var(--success-light); border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 24px; margin-top: 16px; display: none; }
.result.show { display: block; }
.result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.result-header .check { color: var(--success); }
.result-header h3 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1rem; color: var(--success); }
.result-meta { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.result-meta strong { color: var(--text); }
.download-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--success); color: #fff; font-family: 'DM Sans', sans-serif; font-size: .9rem; font-weight: 600; border: none; border-radius: 99px; padding: 11px 24px; cursor: pointer; text-decoration: none; transition: background .15s; }
.download-btn:hover { background: #15803d; }
.preview-wrap { margin-top: 16px; text-align: center; }
.preview-wrap img { max-width: 100%; max-height: 300px; border-radius: 10px; border: 1px solid var(--border); }

/* TIPS */
.tips { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-top: 16px; }
.tips h4 { font-family: 'Syne', sans-serif; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
.tips ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tips li { font-size: .84rem; color: var(--muted); padding-left: 16px; position: relative; }
.tips li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

/* FOOTER */
footer { border-top: 1px solid var(--border); text-align: center; padding: 28px 24px; color: var(--muted); font-size: .8rem; }

@media (max-width: 500px) {
  .row2 { grid-template-columns: 1fr; }
  .tool-page { padding: 28px 16px 60px; }
}
