/* The website's colours and font, in a light layout for daily work */
:root { --primary: #3b0f4f; --secondary: #6a1b9a; --accent: #a970d3; --violet: #7422b8; --ink: #2c0c4a; --muted: #6c4a8c; --lilac: #f4eefb; --line: #e3d3f3; --danger: #a3123f; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { min-height: 100vh; font-family: Alexandria, "Segoe UI", Tahoma, sans-serif; font-size: 14px; line-height: 1.8; color: var(--ink); background: radial-gradient(ellipse at 90% 0, #fff 0, transparent 40%), var(--lilac); }
[hidden] { display: none !important; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 22px; border: 0; border-radius: 99px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; color: #fff; background: linear-gradient(90deg, #a52fd0, #641aa6); box-shadow: 0 6px 16px rgba(120, 35, 180, .25); transition: translate .2s, box-shadow .2s, opacity .2s; }
.btn:hover { translate: 0 -2px; box-shadow: 0 10px 22px rgba(120, 35, 180, .32); }
.btn.ghost { color: var(--violet); background: #fff; border: 1px solid var(--line); box-shadow: none; }
.btn.danger { color: var(--danger); background: #fff; border: 1px solid #f0c4d2; box-shadow: none; }
.btn.small { min-height: 34px; padding: 0 13px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; translate: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ===== Top bar ===== */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 10px max(16px, calc(50% - 560px)); color: #fff; background: linear-gradient(100deg, #210d36, #3b0f4f 60%, #571892); box-shadow: 0 8px 24px rgba(40, 6, 75, .25); }
.top img { width: 130px; height: auto; }
.top nav { display: flex; gap: 6px; margin-inline-end: auto; }
.top nav a, .top > button { padding: 7px 14px; border: 0; border-radius: 99px; font-size: 13px; text-decoration: none; color: #fff; background: transparent; cursor: pointer; transition: background .2s; }
.top nav a:hover, .top > button:hover, .top nav a[aria-current] { background: rgba(255, 255, 255, .14); }

main { max-width: 1152px; margin: 0 auto; padding: 24px 16px 110px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; translate: 0 14px; } }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { font-size: 23px; line-height: 1.6; }
.hint { font-size: 12px; color: var(--muted); }

.card { margin-bottom: 16px; padding: 20px; border: 1px solid #fff; border-radius: 22px; background: #fff; box-shadow: 0 12px 28px rgba(96, 40, 150, .1); }
.card > h2 { margin-bottom: 4px; font-size: 16px; }
.card > .hint { margin-bottom: 14px; }

/* ===== Fields ===== */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.full { grid-column: 1 / -1; }
.field { display: block; min-width: 0; }
.field > span { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); direction: ltr; }
input, select, textarea { width: 100%; min-width: 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; background: #fcfaff; transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(116, 34, 184, .15); }
input[dir="ltr"] { text-align: left; }
input:read-only { color: var(--muted); background: #f1ecf8; }
.field small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.invalid input, .invalid textarea, .invalid select, .card.invalid { border-color: var(--danger); }
.field-error { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--danger); }

/* ===== Lists inside the editor ===== */
.row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 9px; animation: rise .25s ease; }
.row > .inputs { flex: 1; display: grid; gap: 7px; min-width: 0; }
.row.pair > .inputs { grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); }
.row textarea { min-height: 62px; }
.tools { display: flex; gap: 4px; }
.icon-btn { flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: background .2s; }
.icon-btn:hover { background: #f1e6fb; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 14px; }
.picture { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fcfaff; animation: rise .3s ease; }
.picture figure { position: relative; aspect-ratio: 16 / 9; background: #1d0731; }
.picture img { width: 100%; height: 100%; object-fit: cover; }
.picture figcaption { position: absolute; top: 8px; right: 8px; padding: 2px 11px; border-radius: 99px; font-size: 11px; font-weight: 600; color: #fff; background: var(--violet); }
.picture > div { padding: 10px; }
.picture textarea { min-height: 58px; font-size: 12px; }
.picture .tools { margin-top: 8px; justify-content: flex-end; }

/* Search result as it may look in Google */
.snippet { margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.snippet cite { display: block; font-style: normal; font-size: 12px; color: #4d5156; direction: ltr; text-align: right; overflow-wrap: anywhere; }
.snippet b { display: block; font-size: 17px; font-weight: 500; color: #1a0dab; overflow-wrap: anywhere; }
.snippet p { font-size: 12.5px; color: #4d5156; overflow-wrap: anywhere; }

.actions { position: fixed; z-index: 9; right: 0; left: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; background: rgba(255, 255, 255, .94); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(60, 15, 105, .1); }

/* ===== Project list ===== */
.list { display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 0; padding: 12px; animation: rise .35s ease backwards; }
.item > img, .item > .no-picture { width: 150px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 13px; background: #efe4fa; }
.item > .no-picture { display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.item h2 { font-size: 15.5px; overflow-wrap: anywhere; }
.item p { font-size: 12px; color: var(--muted); }
.item .tools { flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.badge { display: inline-block; padding: 1px 11px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge.published { color: #0b5d33; background: #d9f4e5; }
.badge.changed { color: #7a4b00; background: #ffedc7; }
.badge.draft { color: var(--secondary); background: #efe1fb; }
.badge.hidden { color: #55505c; background: #e8e6ea; }

/* ===== Login ===== */
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(ellipse at 20% 80%, #7a25bd, transparent 50%), linear-gradient(180deg, #210d36, #34115c); }
.login form { width: 100%; max-width: 380px; display: grid; gap: 14px; padding: 30px 26px; border-radius: 26px; background: #fff; box-shadow: 0 30px 60px rgba(8, 0, 20, .45); animation: rise .5s ease; }
.login .logo { width: 190px; height: auto; margin: 0 auto; }
.login h1 { text-align: center; font-size: 18px; }
.error { min-height: 1.8em; font-size: 12.5px; font-weight: 600; text-align: center; color: var(--danger); }
.narrow { max-width: 460px; }

/* ===== Quote requests and settings ===== */
.page-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 16px 20px; animation: rise .35s ease; }
.page-item h2 { font-size: 15.5px; }
.count { display: inline-block; min-width: 19px; margin-inline-start: 6px; padding: 0 5px; border-radius: 99px; font-size: 11px; line-height: 19px; text-align: center; color: #2c0c4a; background: #e9c8ff; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { padding: 7px 17px; border: 1px solid var(--line); border-radius: 99px; font-size: 12.5px; font-weight: 600; background: #fff; cursor: pointer; transition: background .2s, color .2s; }
.tab[aria-pressed="true"] { border-color: transparent; color: #fff; background: linear-gradient(90deg, #a52fd0, #641aa6); }
.quote { animation: rise .35s ease; }
.quote-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.quote-head h2 { font-size: 16px; overflow-wrap: anywhere; }
.quote .details { margin: 10px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.contact, .quote-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quote textarea { min-height: 54px; margin: 12px 0 10px; }
.quote-tools select { width: auto; min-height: 34px; padding-block: 5px; }
.wrap-text { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.badge.q-new { color: var(--secondary); background: #efe1fb; }
.badge.q-contacted { color: #7a4b00; background: #ffedc7; }
.badge.q-closed { color: #55505c; background: #e8e6ea; }
.badge { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); }
.warning { border-color: #f1d48c; background: #fff8e6; font-size: 13px; }
.figure-row { display: grid; grid-template-columns: 70px 100px 70px minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.check { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 46px; font-size: 13px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); }

/* ===== Confirmation box ===== */
.confirm { width: min(420px, calc(100% - 32px)); margin: auto; padding: 22px; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 30px 70px rgba(20, 0, 40, .4); animation: rise .25s ease; }
.confirm::backdrop { background: rgba(33, 13, 54, .55); }
.confirm h2 { font-size: 17px; }
.confirm p { margin-top: 6px; font-size: 13.5px; overflow-wrap: anywhere; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn.solid-danger { background: var(--danger); box-shadow: 0 6px 16px rgba(163, 18, 63, .25); }

/* ===== Two-step login ===== */
.card.narrow > form { margin-top: 10px; }
.qr { width: 240px; max-width: 100%; height: auto; margin: 10px auto; border: 1px solid var(--line); border-radius: 14px; }
.secret { padding: 10px; border: 1px dashed var(--line); border-radius: 12px; font: 600 14px Consolas, monospace; text-align: center; overflow-wrap: anywhere; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; list-style: none; }
.codes li { padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; font: 600 14px Consolas, monospace; text-align: center; user-select: all; }

/* ===== Error screens ===== */
.error-screen { max-width: 480px; margin: 40px auto; padding: 32px 24px; text-align: center; animation: rise .35s ease; }
.error-screen h1 { font-size: 20px; }
.error-screen > p:not(.error-code) { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.error-code { font-size: 54px; font-weight: 800; line-height: 1.3; direction: ltr; color: var(--accent); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: radial-gradient(ellipse at 20% 80%, #7a25bd, transparent 50%), linear-gradient(180deg, #210d36, #34115c); }
.error-page .error-screen { width: 100%; margin: 18px 0 0; }
.error-logo { width: 180px; height: auto; }
.crash-bar { position: fixed; z-index: 40; inset: auto 12px 12px; max-width: 560px; margin: 0 auto; padding: 14px 16px; border: 1px solid #f0c4d2; border-radius: 18px; text-align: center; background: #fff; box-shadow: 0 18px 40px rgba(20, 0, 40, .35); animation: rise .3s ease; }
.crash-bar p { font-size: 13px; font-weight: 600; color: var(--danger); }
.crash-bar .error-actions { margin-top: 10px; }

#toast { position: fixed; z-index: 30; right: 50%; bottom: 84px; translate: 50% 20px; width: max-content; max-width: calc(100% - 28px); padding: 11px 22px; border-radius: 18px; font-size: 13px; font-weight: 600; text-align: center; color: #fff; background: #25113d; box-shadow: 0 14px 30px rgba(20, 0, 40, .35); visibility: hidden; opacity: 0; transition: opacity .25s, translate .25s, visibility .25s; }
#toast.show { cursor: pointer; visibility: visible; opacity: 1; translate: 50% 0; }
#toast.bad { background: var(--danger); }

@media (max-width: 720px) {
  .top { gap: 6px; padding: 9px 10px; }
  .top img { width: 92px; }
  /* Four menu links need their own row on a phone */
  .top { flex-wrap: wrap; }
  .top > button { margin-inline-start: auto; }
  .top nav { order: 3; flex-basis: 100%; justify-content: space-between; gap: 0; margin: 0; }
  .top nav a, .top > button { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
  .top nav .count { min-width: 16px; margin-inline-start: 3px; padding: 0 3px; font-size: 10px; line-height: 16px; }
  .figure-row { grid-template-columns: 1fr 1.5fr 1fr; }
  .figure-row input:last-child { grid-column: 1 / -1; }
  main { padding: 18px 10px 170px; }
  h1 { font-size: 19px; }
  .card { padding: 15px 13px; border-radius: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .row.pair > .inputs { grid-template-columns: minmax(0, 1fr); }
  .row .tools { flex-direction: column; }
  .item { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .item > img, .item > .no-picture { width: 96px; }
  .item .tools { grid-column: 1 / -1; justify-content: flex-start; }
  .actions { gap: 6px; padding: 10px 8px; }
  .actions .btn { flex: 1 1 28%; padding: 0 8px; }
  #toast { bottom: 140px; }
}
@media (max-width: 380px) {
  .top nav a { padding-inline: 5px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
