/*
 * Alpify Academy — hand-written stylesheet, served as is (no build step:
 * the Plesk server has no Node.js). Works on desktop and tablet.
 */
:root {
    --text: #1f2933;
    --muted: #5f6b7a;
    --line: #d9dee3;
    --surface: #ffffff;
    --bg: #f5f6f8;
    --accent: #1d4f91;
    --accent-soft: #e8eff8;
    --error: #b42318;
    --error-soft: #fdecea;
    --ok: #1b7a3d;
    --ok-soft: #e7f5ec;
    --warn: #8a5a00;
    --warn-soft: #fff4dc;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); }

/* Header */
.site-header {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.site-header .brand { font-weight: 600; color: var(--text); text-decoration: none; }
.site-header nav, .site-header .account { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.site-header nav a { padding: .5rem .25rem; text-decoration: none; }
.site-header nav a[aria-current="page"] { font-weight: 600; border-bottom: 2px solid var(--accent); }

main { max-width: 72rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }

.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

/* Buttons and links styled as buttons; 44px touch targets for tablets */
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .5rem 1rem;
    font: inherit;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
.button.secondary, button.secondary { background: var(--surface); color: var(--accent); }
.button.danger, button.danger { background: var(--surface); color: var(--error); border-color: var(--error); }
button.link { min-height: auto; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; }
button.small, .button.small { min-height: 36px; padding: .25rem .75rem; }

/* Forms */
label, .label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=date], select, textarea {
    width: 100%;
    min-height: 44px;
    padding: .5rem .6rem;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
textarea { min-height: 5rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; background: var(--surface); }
legend { font-weight: 600; padding: 0 .25rem; }
.field { margin-bottom: .9rem; }
.field .hint { font-size: .875rem; color: var(--muted); }
.field .error, .error { color: var(--error); font-size: .9rem; margin-top: .2rem; }
.grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.choices { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.choices label { font-weight: normal; display: inline-flex; gap: .4rem; align-items: center; min-height: 44px; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }

/* Panels, tables, badges */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.card.narrow { max-width: 28rem; margin: 3rem auto; padding: 1.5rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .875rem; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1rem; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .825rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.status-new { background: var(--warn-soft); color: var(--warn); }
.badge.status-won { background: var(--ok-soft); color: var(--ok); }
.badge.status-lost, .badge.status-declined, .badge.status-superseded { background: #eceef1; color: var(--muted); }
.badge.status-draft { background: var(--warn-soft); color: var(--warn); }
.badge.status-accepted { background: var(--ok-soft); color: var(--ok); }
.badge.age-old { background: var(--error-soft); color: var(--error); }

.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tabs a { padding: .5rem 1rem; min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--accent); color: #fff; border-color: var(--accent); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

.columns { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }

.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--muted); font-size: .875rem; }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.flash.error { color: var(--error); background: var(--error-soft); border-color: transparent; }

.contact-results { list-style: none; margin: .5rem 0 0; padding: 0; }
.contact-results li label { font-weight: normal; display: flex; gap: .6rem; align-items: center; min-height: 44px; padding: .25rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .4rem; background: var(--surface); }

details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
