/* SSH Key Generator — Modern Responsive Design */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --accent:        #6a9a10;
  --accent-hover:  #547d0c;
  --accent-light:  #f3f8e8;
  --text:          #1a1a1a;
  --text-muted:    #555;
  --border:        #d4d4d4;
  --bg:            #f5f5f5;
  --card-bg:       #ffffff;
  --code-bg:       #1e1e2e;
  --code-text:     #cdd6f4;
  --radius:        10px;
  --shadow:        0 2px 8px rgba(0,0,0,.08);
  --max-width:     760px;
  --font:          system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

/* ── Layout ─────────────────────────────────────────────────── */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: var(--accent);
  color: #fff;
  padding: 28px 16px 24px;
  text-align: center;
  margin-bottom: 28px;
}
header img {
  display: block;
  margin: 0 auto 14px;
  height: 72px;
  width: auto;
}
header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -.5px;
}
header p {
  font-size: .95rem;
  opacity: .88;
  margin-top: 4px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}

/* ── Intro card: image + text side by side ──────────────────── */
.intro-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}
.intro-grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* ── Form ───────────────────────────────────────────────────── */
.form-card { background: var(--accent-light); border: 1px solid #c8dda0; }
.form-card h2 { color: var(--accent); border-bottom-color: #c8dda0; }

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}
.field label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 1rem;
  font-family: var(--font);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(106,154,16,.18);
}
.field input:invalid {
  background: #fff0f0;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.btn {
  width: 100%;
  padding: 11px 0;
  border: none;
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #e0e0e0; color: var(--text); }
.btn-secondary:hover { background: #cecece; }

/* ── Code blocks ────────────────────────────────────────────── */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .875rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 12px 0;
}
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .9em;
  background: #eef2e6;
  padding: 1px 5px;
  border-radius: 4px;
}
pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ── Inline text helpers ─────────────────────────────────────── */
.text-muted { color: var(--text-muted); font-size: .95rem; }
p + p { margin-top: .75em; }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
  padding: 20px 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 0;
}
footer a { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 560px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }
  .intro-grid img {
    max-width: 240px;
    margin: 0 auto;
  }
  .card { padding: 18px 16px; }
  header { padding: 20px 16px 18px; }
  header img { height: auto; max-width: 90%; display: block; margin: 0 auto 14px; }
}
