:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --accent:#2563eb;
  --border:#dbeafe;
  --error:#dc2626;
  --muted:#6b7280;
  --shadow:0 10px 24px rgba(16,24,40,0.08);
  --radius:14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; 
  background:linear-gradient(180deg,var(--bg),#eef2ff 100%);
  color:#0f172a; 
  display:flex; 
  align-items:flex-start; 
  justify-content:center; 
  padding:40px 24px;
  overflow: auto;
  -webkit-font-smoothing:antialiased; 
  -moz-osx-font-smoothing:grayscale;
}

.container{width:100%;max-width:860px}
h1{margin:0 0 6px}
.subtitle{color:var(--muted);margin:0 0 18px}
.footer{margin-top:16px;color:var(--muted);font-size:.9rem;text-align:center}

form{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; box-shadow:var(--shadow);
}
.row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:720px){.row{grid-template-columns:1fr}}

.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
label{font-weight:600}
input, textarea{
  padding:12px 14px; border-radius:10px; border:1px solid var(--border); outline:none; font-size:1rem;
}
input:focus, textarea:focus{border-color:#93c5fd; box-shadow:0 0 0 3px rgba(37,99,235,.15)}
textarea{resize:vertical}

.help{min-height:1rem;color:var(--muted)}
.muted{color:var(--muted)}
.flex-between{display:flex;justify-content:space-between;align-items:center}

.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
button{
  padding:12px 16px; border:none; border-radius:10px; cursor:pointer; font-weight:600; box-shadow:var(--shadow);
  background:var(--accent); color:#fff;
}
button:disabled{opacity:.6;cursor:not-allowed}
button.ghost{background:#e5e7eb;color:#111827}

.status{min-height:22px;margin-top:8px;color:var(--muted)}
.result{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:16px; margin-top:14px; box-shadow:var(--shadow);
}
.hidden{display:none}

.invalid input, .invalid textarea{border-color:var(--error)}
.invalid .help{color:var(--error)}
