/* codesey.com: landing page, accounts, catalog, admin. No framework, no JS. */
:root {
    --brand: #164270;
    --brand-dark: #0b1118;
    --accent: #0063b1;
    --accent-hover: #004f8f;
    --bg: #f5f7fa;
    --card: #fff;
    --fg: #1c2733;
    --muted: #5d6b79;
    --line: #dde3ea;
    --danger: #c42b1c;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: .2em 0 .5em; text-wrap: balance; }
h2 { font-size: 26px; margin: 1.2em 0 .5em; }
h3 { font-size: 18px; margin: 0; }
code { background: #e9eef4; padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(440px, 100% - 40px); margin: 48px auto; }
.narrow-wide { width: min(780px, 100% - 40px); margin-inline: auto; }
.section { padding: 28px 0; }
.muted { color: var(--muted); } .small { font-size: 14px; } .right { text-align: right; }
.inline { display: inline; }

/* header / footer */
.site-header { background: var(--brand-dark); color: #fff; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: .02em; }
.site-header nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-header nav a, .site-header .link { color: #d6dee7; text-decoration: none; font-size: 15px; }
.site-header nav a:hover, .site-header nav a.active, .site-header .link:hover { color: #fff; }
.site-header nav a.btn { color: #fff; }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: 14px; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-block; padding: 9px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--fg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--fg); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-small { padding: 5px 12px; font-size: 14px; }
.btn-large { padding: 13px 26px; font-size: 17px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #dff3e4; color: #1c6b34; font-size: 13px; font-weight: 600; margin-right: 6px; }
.badge-draft { background: #eceff3; color: var(--muted); }

/* hero */
.hero { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); }
.lead { font-size: 19px; color: #d6e2ee; max-width: 36em; }
.lead-dark { font-size: 18px; max-width: 42em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-shot { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.12); }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } }

/* cards & grids */
.grid { display: grid; gap: 18px; margin-top: 16px; }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card p { margin: .5em 0 0; }
.step { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.empty { padding: 28px; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); }

/* software cards & detail */
.sw-card { display: flex; flex-direction: column; gap: 6px; }
.sw-head { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.sw-head h3 { color: var(--fg); }
.sw-summary { flex: 1; color: #384553; }
.sw-actions { margin-top: 10px; }
.sw-icon { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--brand); padding: 8px; object-fit: contain; }
.sw-letter { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; padding: 0; }
.detail-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h1 { margin: 0; }
.detail-head .sw-icon { width: 72px; height: 72px; border-radius: 16px; padding: 12px; }
.detail-action { margin-left: auto; }
.prose { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-top: 16px; overflow-wrap: anywhere; }
.search { display: flex; gap: 8px; }
.search input { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 200px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 600; margin-top: 10px; }
.form label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=file], .form textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.form input:focus, .form textarea:focus, .search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form .btn { margin-top: 16px; align-self: flex-start; }
.error { color: var(--danger); margin: 2px 0 0; font-size: 14px; }
.flash { background: #e6f4ea; border: 1px solid #b9e0c4; color: #1c5c30; padding: 10px 16px; border-radius: 8px; margin: 16px 0 0; }
.danger { margin-top: 24px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 16px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }

/* admin table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #eef2f6; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
