/* Colours and fonts of the Küchenstudio Anderka website */
@font-face { font-family: 'Roboto'; font-weight: 400; font-display: swap; src: url('/fonts/roboto-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-weight: 500; font-display: swap; src: url('/fonts/roboto-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-weight: 700; font-display: swap; src: url('/fonts/roboto-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Frank Ruhl Libre'; font-weight: 500; font-display: swap; src: url('/fonts/frank-ruhl-libre-latin-500-normal.woff2') format('woff2'); }

:root {
  --red: #af232f;
  --red-dark: #8c1c26;
  --slate: #353c40;
  --text: #282828;
  --dark: #1b1e20;
  --light: #fafbfd;
  --border: #d5d9dc;
  --white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  color: var(--text);
  background: var(--light);
  line-height: 1.5;
}

.site-header {
  background: var(--white);
  border-bottom: 4px solid var(--red);
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.logo { height: 56px; width: auto; }

h1, h2 {
  font-family: 'Frank Ruhl Libre', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin: 0;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; margin-bottom: 1rem; }

main { max-width: 960px; margin: 0 auto; padding: 1rem; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

details.card summary { cursor: pointer; list-style-position: outside; margin-left: 1rem; }
details.card summary h2 { display: inline; }
details[open].card summary { margin-bottom: 1rem; }

.grid { display: grid; gap: 0.75rem 1rem; grid-template-columns: 1fr; }

label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 500; font-size: 0.95rem; margin-bottom: 0.75rem; }
.grid label { margin-bottom: 0; }
.grid + label { margin-top: 0.75rem; }
label small, .hint { font-weight: 400; color: var(--slate); font-size: 0.85rem; }
.hint { margin-top: 0; }

input, select, textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--white);
  color: var(--text);
  width: 100%;
}

input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.line {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  margin: 0 0 0.75rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}
.line legend { font-weight: 700; color: var(--slate); padding: 0 0.25rem; }
.line label { margin-bottom: 0; }
.line .wide, .line .line-sum { grid-column: 1 / -1; }
.line-sum { margin: 0; color: var(--slate); }

button {
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 3px;
  padding: 0.65rem 1.2rem;
  border: 2px solid var(--red);
}
.primary { background: var(--red); color: var(--white); width: 100%; font-size: 1.05rem; }
.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.primary:disabled { opacity: 0.6; cursor: wait; }
.secondary { background: var(--white); color: var(--red); }
.link { background: none; border: none; color: var(--red); padding: 0; text-decoration: underline; justify-self: start; grid-column: 1 / -1; }

.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.totals dt { color: var(--slate); }
.totals dd { margin: 0; text-align: right; }
.totals dt:last-of-type, .totals dd:last-of-type { font-weight: 700; color: var(--dark); font-size: 1.1rem; }

.errors {
  border-left: 4px solid var(--red);
  background: #fbeaec;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.errors p { margin: 0 0 0.25rem; font-weight: 700; }
.errors ul { margin: 0; padding-left: 1.2rem; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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

/* navigation */
.brand { display: inline-flex; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: center; margin-left: auto; }
.site-header nav a { color: var(--slate); text-decoration: none; font-weight: 500; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.site-header nav a[aria-current="page"], .site-header nav a:hover { color: var(--red); border-bottom-color: var(--red); }
.site-header nav .link { grid-column: auto; color: var(--slate); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.site-header nav .link:hover { color: var(--red); border-bottom-color: var(--red); }

.page-title { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; margin: 0.5rem 0 1rem; }

a.button { display: inline-block; text-decoration: none; text-align: center; border-radius: 3px; padding: 0.65rem 1.2rem; border: 2px solid var(--red); font-weight: 500; }
a.button.primary { color: var(--white); width: auto; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }
.button-row .primary { width: auto; }
.danger-row { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.danger { background: var(--white); color: #8c1c26; border-color: #8c1c26; }

/* lists */
.search { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 1rem; }
.search label { flex: 1 1 14rem; margin: 0; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { font-weight: 500; color: var(--slate); font-size: 0.9rem; }
table.list .num { text-align: right; white-space: nowrap; }
table.list .actions { text-align: right; }
table.list .link { grid-column: auto; text-align: left; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.plain-list .link { grid-column: auto; }

.success { border-left: 4px solid #2e7d32; background: #e8f5e9; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.success p { margin: 0; }

.customer-pick { display: grid; gap: 0.75rem 1rem; }
.customer-pick label { margin: 0; }
.customer-info { margin: 0.5rem 0 0; padding: 0.5rem 0.75rem; background: var(--light); border-left: 3px solid var(--red); }

.choice { border: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.choice legend { font-weight: 500; margin-bottom: 0.25rem; padding: 0; }
label.inline { flex-direction: row; align-items: center; gap: 0.5rem; margin: 0; font-weight: 400; }
label.inline input { width: auto; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0 0 1.5rem; }
.facts dt { color: var(--slate); }
.facts dd { margin: 0; }
.downloads { display: grid; gap: 1rem; }
.downloads .button { margin: 0 0.5rem 0.5rem 0; }

.totals .total { font-weight: 700; color: var(--dark); font-size: 1.1rem; }
textarea { resize: vertical; }

.site-footer { display: flex; justify-content: center; gap: 1.5rem; padding: 1.5rem 1rem 2rem; font-size: 0.9rem; }
.site-footer a { color: var(--slate); }

/* login */
.narrow { max-width: 420px; margin: 0 auto; padding: 2rem 1rem; }
.logo-large { display: block; width: 220px; max-width: 70%; height: auto; margin: 0 auto 1.5rem; }
.login-page h1 { margin-bottom: 1rem; }
.login-page .primary { width: 100%; }

@media (min-width: 640px) {
  .customer-pick { grid-template-columns: 1fr 2fr; }
  .downloads { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .line { grid-template-columns: repeat(4, 1fr); }
  .line .wide { grid-column: 2 / -1; }
  .primary { width: auto; }
  h1 { font-size: 1.9rem; }
}
