/* Colourside app: logging in, the list of sites, the account. The same
   quiet look as the editor, so the owner's site stays the colourful thing. */

:root {
  --ink: #16191d;
  --muted: #5d6673;
  --line: #dde2e8;
  --field: #c6cdd5;
  --soft: #f6f7f9;
  --panel: #ffffff;
  --accent: #2d5be3;
  --accent-dark: #2149bf;
  --accent-soft: #eaf0fd;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #17663a;
  --ok-soft: #e6f4ea;
  --warn-bg: #fff3dc;
  --warn-ink: #714400;
  --radius: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; }
h2 { margin: 0 0 8px; font-size: 17px; line-height: 1.3; }
p { margin: 0 0 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---- Pages without a login: one column in the middle ---- */

.solo {
  max-width: 26rem;
  margin: 0 auto;
  padding: 48px 16px 64px;
}
.solo-logo { display: block; width: fit-content; margin: 0 auto 28px; }
.solo-logo img { display: block; width: 176px; height: auto; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}
.lead { color: var(--muted); margin-bottom: 20px; }
.aside { margin: 20px 0 0; text-align: center; color: var(--muted); }
.fine { margin: 16px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 30rem) {
  .solo { padding-top: 28px; }
  .card { padding: 20px 16px; }
}

/* ---- Pages after logging in ---- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.top .logo img { display: block; width: 132px; height: auto; }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav a, .top-nav .link {
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.top-nav a:hover, .top-nav .link:hover { background: var(--soft); color: var(--ink); }
.top-nav form { margin: 0; }
.link { border: 0; background: none; }

.main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.narrow { max-width: 40rem; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1 { margin: 0; }

@media (max-width: 30rem) {
  .top .logo img { width: 112px; }
  .top-nav a, .top-nav .link { padding: 6px 7px; }
  .main { padding-top: 24px; }
}

/* ---- Messages ---- */

.notice, .alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
}
.notice { background: var(--ok-soft); color: var(--ok); }
.alert { background: var(--danger-soft); color: var(--danger); }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.banner p { margin: 0; flex: 1 1 20rem; }
.banner form { margin: 0; }

/* ---- Forms ---- */

.field { margin: 0 0 18px; }
.field label, fieldset > legend {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row a { font-size: 13.5px; }

input[type="text"], input[type="email"], input[type="password"] {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: #fff;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[aria-invalid="true"] { border-color: var(--danger); }

.password { position: relative; }
.password input { padding-right: 68px; }
.password .show {
  position: absolute;
  top: 4px; right: 4px; bottom: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.password .show:hover { background: var(--soft); color: var(--ink); }

.problem { margin: 6px 0 0; color: var(--danger); font-size: 13.5px; }
.problem a { color: inherit; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

fieldset { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
fieldset > legend { padding: 0; }
fieldset > .hint { margin: -2px 0 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.wide { width: 100%; padding: 10px 16px; font-size: 15px; }

/* ---- The list of sites ---- */

.site-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.site-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.site-text { min-width: 0; flex: 1 1 16rem; }
.site-text h2 { margin: 0 0 2px; font-size: 18px; }
.site-text h2 a { color: var(--ink); text-decoration: none; }
.site-text h2 a:hover { text-decoration: underline; }
.site-status { margin: 0; color: var(--muted); font-size: 14px; }
.site-address { margin: 0 0 4px; font-size: 14px; overflow-wrap: anywhere; }
.site-address .quiet { margin-left: 6px; color: var(--muted); font-size: 13px; }
.site-actions { display: flex; gap: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; }
.dot.draft { background: var(--field); }
.dot.changed { background: #e0a106; }
.dot.live { background: #1f9d55; }

/* ---- Starting a site ---- */

.stack { margin-top: 24px; }

.look-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 12px;
}
.look {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 0 0 14px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 400 !important;
}
.look img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  object-position: left top;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.look-head, .look-text, .look-suits { padding: 0 14px; }
.look-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.look-text { font-size: 13.5px; }
.look-suits { color: var(--muted); font-size: 12.5px; }
.look input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.look:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.look:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* On a phone, each look is a row: a small picture beside its words. */
@media (max-width: 34rem) {
  .look { grid-template-columns: 7rem 1fr; column-gap: 12px; padding: 10px 12px 10px 10px; }
  .look img { grid-row: span 3; margin: 0; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; }
  .look-head, .look-text, .look-suits { grid-column: 2; padding: 0; }
}

/* ---- The account ---- */

.panel {
  margin: 0 0 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.panel > p { color: var(--muted); }
.panel > p strong { color: var(--ink); }
.row-form { display: flex; gap: 8px; align-items: flex-start; }
.row-form .field { flex: 1; margin: 0; }
details > summary { color: var(--accent); cursor: pointer; font-weight: 600; font-size: 14px; }
details[open] > summary { margin-bottom: 16px; }
details form .hint { margin: -6px 0 14px; }
h1 + .banner { margin-top: 16px; }

/* ---- Publishing and the address ---- */

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* The address box: what's typed, then the free domain after it in grey. */
.address-box {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  background: #fff;
}
.address-box:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.address-box.invalid { border-color: var(--danger); }
.address-box input[type="text"] { flex: 1 1 auto; min-width: 0; border: 0; border-radius: 0; }
.address-box input:focus { outline: none; }
.address-domain {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 30rem) {
  .address-box { flex-wrap: wrap; }
  .address-box input[type="text"] { flex-basis: 100%; }
  .address-domain { flex: 1 1 100%; padding: 6px 11px; border-left: 0; border-top: 1px solid var(--line); }
}

.online h1 { margin-bottom: 4px; }
.online-address { font-size: 19px; font-weight: 600; overflow-wrap: anywhere; margin-bottom: 16px; }
.online-address a { text-decoration: none; }
.online-address a:hover { text-decoration: underline; }
.hint.hold { margin: 0 0 18px; }
