/* locates.me - shared styles
   Brand palette is taken from the Davies IT document standards. */

:root {
  --blue: #367da2;
  --blue-dark: #2b657f;
  --tint: #ddeaf2;
  --ink: #2C2C3E;
  --muted: #6B6B80;
  --rule: #e4e4ec;
  --stripe: #F4F4F8;
  --bg: #ffffff;
  --red: #a23636;
  --red-tint: #f6e3e3;
  --green: #2e7d4f;
  --green-tint: #e2f1e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Layout that centres a short page vertically without breaking on
   small screens - min-height rather than fixed height. */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Top and bottom only - "padding: 48px 0" would wipe out the side
     gutters that .wrap sets, and the text would touch the screen edge
     on a phone. */
  padding-top: 48px;
  padding-bottom: 48px;
}

/* Longer pages (the dashboard) start at the top instead. */
.page {
  padding-top: 40px;
  padding-bottom: 48px;
}

.brand {
  font-size: 30px;
  font-weight: bold;
  letter-spacing: -0.5px;
  color: var(--blue);
  margin: 0 0 4px;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.brand .dot {
  color: var(--muted);
  font-weight: normal;
}

.tagline {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 32px;
}

h1 {
  font-size: 22px;
  margin: 0 0 12px;
  color: var(--ink);
}

h2 {
  font-size: 17px;
  margin: 32px 0 10px;
  color: var(--ink);
}

p {
  margin: 0 0 16px;
}

.lede {
  font-size: 17px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.card {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blue);
  background: var(--tint);
  border-radius: 4px;
  padding: 20px 22px;
  margin: 0 0 24px;
  /* Long handles must never push the card past the viewport edge. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.handle {
  font-size: 20px;
  font-weight: bold;
  color: var(--blue-dark);
  display: block;
  margin-bottom: 4px;
}

.coords {
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  color: var(--ink);
}

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}

.btn:hover,
.btn:focus {
  background: var(--blue-dark);
}

.btn:disabled {
  background: var(--muted);
  cursor: default;
}

/* A quieter button for secondary actions - cancel, sign out, edit. */
.btn-quiet {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}

.btn-quiet:hover,
.btn-quiet:focus {
  background: var(--tint);
  color: var(--blue-dark);
}

/* The one destructive action on the site. */
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}

.btn-danger:hover,
.btn-danger:focus {
  background: var(--red-tint);
  color: var(--red);
}

.btn-small {
  padding: 7px 14px;
  font-size: 14px;
}

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

.foot {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}

code {
  font-family: "Courier New", Courier, monospace;
  background: var(--stripe);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}

/* ---- Forms (Week 3) ---------------------------------------------------- */

form {
  margin: 0 0 24px;
}

.field {
  margin: 0 0 18px;
}

.field label {
  display: block;
  font-weight: bold;
  font-size: 14px;
  margin: 0 0 6px;
}

.field .hint {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid #b9b9c8;
  border-radius: 4px;
  background: #fff;
}

input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

input[readonly] {
  background: var(--stripe);
  color: var(--muted);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}

.check input {
  margin-top: 3px;
}

/* Two inputs side by side - latitude and longitude. */
.row {
  display: flex;
  gap: 14px;
}

.row .field {
  flex: 1;
  min-width: 0;
}

@media (max-width: 460px) {
  .row {
    display: block;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0 0;
}

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

.notice {
  border-radius: 4px;
  padding: 12px 16px;
  margin: 0 0 20px;
  font-size: 15px;
  border: 1px solid var(--rule);
  background: var(--stripe);
  overflow-wrap: anywhere;
}

.notice-error {
  background: var(--red-tint);
  border-color: #e0bcbc;
  color: var(--red);
}

.notice-ok {
  background: var(--green-tint);
  border-color: #bcdcc8;
  color: var(--green);
}

.notice:empty {
  display: none;
}

/* ---- Dashboard --------------------------------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 28px;
}

.topbar .brand {
  margin: 0;
}

.status {
  display: inline-block;
  font-size: 13px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--blue-dark);
  vertical-align: middle;
}

.status-off {
  background: var(--stripe);
  color: var(--muted);
}

.handle-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.handle-list li {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  padding: 16px 18px;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.handle-list .handle {
  font-size: 18px;
}

.handle-list .handle a {
  text-decoration: none;
  color: inherit;
}

.handle-list .handle a:hover {
  text-decoration: underline;
}

.handle-list .actions {
  margin-top: 12px;
}

.empty {
  border: 1px dashed #b9b9c8;
  border-radius: 4px;
  padding: 20px 22px;
  color: var(--muted);
  margin: 0 0 24px;
}

.danger-zone {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
