/* The look of the pro.rco.se landing page (~/www/css/style.css), with the font
   served from here so the page loads nothing from other sites (CSP 'self'). */

@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lato-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lato-400-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lato-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/lato-700-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F;
}

:root {
  --rco-petrol: #003b49;
  --rco-red: #da291c;
  --text: #0a0a0a;
  --muted: #555;
  --line: #e8e8e8;
  --bg: #f5f5f5;
  --card: #fff;
  --rco-fab: #265259; /* the floating buttons on www.rco.se */
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Lato', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.rco-header {
  background-color: var(--rco-petrol);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.rco-logo {
  display: flex;
  align-items: center;
}

.rco-logo img {
  height: 32px;
  width: auto;
}

.lang-switch {
  display: flex;
  gap: 4px;
}

.lang-switch button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  text-transform: uppercase;
}

.lang-switch button:hover,
.lang-switch button:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.lang-switch button[aria-pressed="true"] {
  color: #fff;
  border-color: #fff;
}

/* Main content */
.rco-main {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.card h1,
.card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--rco-petrol);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rco-petrol);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card p {
  margin-bottom: 12px;
}

.card p:last-child {
  margin-bottom: 0;
}

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

.card.error {
  border-left: 4px solid var(--rco-red);
}

/* Fact lists */
.facts {
  list-style: none;
}

.facts li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.facts li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.facts .label {
  color: var(--rco-petrol);
  font-weight: 700;
  margin-right: 6px;
}

.facts .value {
  font-variant-numeric: tabular-nums;
}

.facts .help {
  display: block;
  margin-top: 2px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--rco-petrol);
  border: 1px solid var(--rco-petrol);
  border-radius: 10px;
  padding: 0 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

/* Links and buttons */
.card a {
  color: var(--rco-red);
  text-decoration: none;
}

.card a:hover,
.card a:focus-visible {
  text-decoration: underline;
}

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

.button {
  display: inline-block;
  font-weight: 700;
  color: #fff !important;
  background: var(--rco-petrol);
  border-radius: 4px;
  padding: 10px 18px;
  text-decoration: none !important;
}

.button:hover,
.button:focus-visible {
  background: #00566b;
}

.button.secondary {
  color: var(--rco-petrol) !important;
  background: transparent;
  border: 2px solid var(--rco-petrol);
  padding: 8px 16px;
}

/* The upload form */
/* What a log must not contain: an instruction, so it stands out from the help */
.card .upload-rules {
  border-left: 4px solid var(--rco-petrol);
  background: var(--bg);
  padding: 8px 12px;
  font-weight: 700;
}

.upload-form {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.upload-form label {
  font-weight: 700;
  margin-top: 8px;
}

.upload-form input,
.upload-form textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  width: 100%;
  background: #fff;
}

.upload-form button {
  justify-self: start;
  margin-top: 12px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.upload-form button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.upload-status {
  margin-top: 12px;
  font-weight: 700;
}

.upload-status.ok {
  color: var(--rco-petrol);
}

.upload-status.error {
  color: var(--rco-red);
}

/* The reference after an upload, with a button that copies it */
.reference-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  vertical-align: middle;
}

.reference {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--rco-petrol);
}

.copy-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--rco-petrol);
  background: #fff;
  border: 1px solid var(--rco-petrol);
  border-radius: 4px;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  color: #fff;
  background: var(--rco-petrol);
}

.copy-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-button .icon-done,
.copy-button.copied .icon-copy {
  display: none;
}

.copy-button.copied .icon-done {
  display: block;
}

.copy-note {
  font-weight: 400;
  color: var(--muted);
}

/* Off screen while the old way of copying selects it */
.copy-buffer {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* The receipt, as a dialog over the page */
.upload-done {
  margin: auto;
  width: min(440px, calc(100% - 32px));
  padding: 24px;
  color: var(--text);
  background: var(--card);
  border: 0;
  border-top: 4px solid var(--rco-petrol);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.upload-done::backdrop {
  background: rgba(0, 59, 73, 0.55);
}

.upload-done h2 {
  font-size: 1.3em;
  color: var(--rco-petrol);
  margin-bottom: 12px;
}

.upload-done-text {
  font-size: 1.1em;
}

.upload-done-text .reference {
  font-size: 1.35em;
}

.upload-done .copy-note {
  min-height: 1.5em;
  margin: 6px 0 16px;
}

.upload-done .button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

/* The chat and the AI support, floating in the bottom right corner as on www.rco.se */
.support-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.support-dock:empty {
  display: none;
}

.fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 18px;
  border-radius: 999px;
  background: var(--rco-fab);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.fab:hover,
.fab:focus-visible {
  background: var(--rco-petrol);
}

.fab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.fab img {
  width: 20px;
  height: 20px;
  flex: none;
}

/* Room under the last card, so the buttons never cover it. */
.rco-main {
  padding-bottom: 140px;
}

/* Footer */
.rco-footer {
  background-color: var(--rco-petrol);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 16px 24px;
  font-size: 13px;
  flex-shrink: 0;
}

.rco-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.rco-footer a:hover {
  color: #fff;
}

/* Where the footer's centred text would meet the buttons, it moves above them. */
@media (max-width: 720px) {
  .rco-footer {
    padding-bottom: 132px;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .rco-header {
    padding: 0 16px;
  }

  .rco-main {
    padding: 20px 16px 140px;
  }

  .card {
    padding: 18px 16px;
  }
}
