/* ------------------------------------------------------------------
   Plugfest Result Submission - styles

   Colours taken from the EEBUS website:
     Navy   #003063   surfaces, headings
     Orange #EF791F   accent, actions
     Tint   #EDF4F9   light blue surface
   Type: Open Sans when available locally, otherwise the system sans.
   Deliberately NO external webfont: saves a request on the plugfest
   wifi and avoids the Google Fonts debate.
   ------------------------------------------------------------------ */

:root {
  --navy:        #003063;
  --navy-dark:   #001f42;
  --orange:      #ef791f;
  --orange-dark: #d5650f;
  --tint:        #edf4f9;
  --grey-text:   #4a4a4a;
  --grey-soft:   #666666;
  --line:        #d4dde5;
  --bg:          #f5f7f9;
  --white:       #ffffff;
  --ok:          #1d7a3e;
  --warn:        #b26a00;
  --bad:         #b3261e;

  --radius: 6px;
  --gap:    1.25rem;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--grey-text);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------- Top bar ---------------- */

.topbar {
  background: var(--navy);
  color: var(--white);
  padding: 14px 0;
  border-bottom: 3px solid var(--orange);
}

.topbar-inner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .08em;
}

.brand-sub {
  font-size: .95rem;
  color: #b8cbe0;
  letter-spacing: .02em;
}

/* ---------------- Card ---------------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px 26px;
  margin: 20px 0;
}

h1 {
  margin: 0 0 .35em;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .02em;
}

h2 {
  margin: 0 0 .6em;
  font-size: .82rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .09em;
}

.lead {
  margin: 0 0 1.5em;
  color: var(--grey-soft);
}

/* ---------------- Groups and fields ---------------- */

.group {
  padding-top: 1.35rem;
  margin-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.group:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.field { margin-bottom: var(--gap); }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  margin-bottom: .35em;
  font-weight: 600;
  font-size: .94rem;
  color: var(--navy);
}

.req { color: var(--orange); font-weight: 700; }
.opt { color: var(--grey-soft); font-weight: 400; font-size: .85em; }

input[type="text"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--grey-text);
  font: inherit;
  font-size: 16px;            /* prevents auto-zoom in iOS Safari */
}

textarea { resize: vertical; min-height: 9em; line-height: 1.5; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23003063' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(239, 121, 31, .22);
}

input[type="file"] { padding: 9px 12px; background: var(--tint); }

.hint {
  margin: .45em 0 0;
  font-size: .84rem;
  color: var(--grey-soft);
  line-height: 1.45;
}

/* Test ID recognised: the info line confirms what was matched. */
.hint-ok {
  color: var(--navy);
  font-weight: 600;
}

/* Test ID not in the catalogue. A warning, not a refusal - the submission
   goes through either way. */
.hint-warn {
  margin-top: .5em;
  padding: 8px 11px;
  background: #fff6e8;
  border-left: 4px solid var(--warn);
  border-radius: 4px;
  color: #7a4a00;
  font-weight: 600;
}

/* A prefilled value the submitter overrode. Deliberately low-key: this is
   allowed and recorded, not an error to be fixed. */
.hint-deviation {
  margin-top: .45em;
  color: #7a4a00;
}

.is-deviating {
  border-color: var(--warn);
  background: #fffdf8;
}

.hint-error {
  margin-top: .6em;
  padding: 9px 11px;
  background: #fdf1ef;
  border-left: 4px solid var(--bad);
  border-radius: 4px;
  color: #7d1a15;
  font-weight: 600;
}

/* ---------------- Device pair A/B ---------------- */

.pair { display: grid; gap: var(--gap); }

.side {
  position: relative;
  background: var(--tint);
  border-radius: var(--radius);
  padding: 14px 14px 16px 14px;
}

.side-tag {
  position: absolute;
  top: -10px;
  left: 14px;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  background: var(--navy);
  color: var(--white);
  border-radius: 11px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  letter-spacing: .04em;
}

.side .field:first-of-type { margin-top: .3rem; }

@media (min-width: 620px) {
  .pair { grid-template-columns: 1fr 1fr; }
}

/* ---------------- Tester rows ---------------- */

.tester-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.tester-row input { flex: 1 1 auto; min-width: 0; }

.btn-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;                /* comfortable touch target */
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.btn-icon:hover  { border-color: var(--orange); color: var(--orange); }
.btn-icon:active { background: var(--tint); }
.btn-icon.js-del { color: var(--grey-soft); }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-block;
  padding: 13px 22px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-lg { width: 100%; padding: 16px 22px; font-size: 1.05rem; }

.submit-bar { margin-top: 1.75rem; }

@media (min-width: 620px) {
  .btn-lg { width: auto; min-width: 260px; }
}

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

.alert {
  margin: 0 0 1.4rem;
  padding: 13px 15px;
  background: #fdf1ef;
  border: 1.5px solid var(--bad);
  border-left-width: 5px;
  border-radius: var(--radius);
  color: #7d1a15;
}

.alert ul { margin: .5em 0 0; padding-left: 1.2em; }
.alert li { margin: .2em 0; }

/* ---------------- Success page ---------------- */

.success { text-align: center; padding-top: 34px; padding-bottom: 34px; }

.success-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  background: var(--ok);
  color: var(--white);
  border-radius: 50%;
  font-size: 2rem;
  line-height: 62px;
}

.success .ref { margin: 1.3em 0; font-size: .9rem; color: var(--grey-soft); }

.success code {
  padding: 3px 8px;
  background: var(--tint);
  border-radius: 4px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
  color: var(--navy);
  white-space: nowrap;
}

.actions { margin-top: 1.6rem; }

/* ---------------- Bot trap ---------------- */

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------- Footer ---------------- */

.footer {
  margin: 8px auto 40px;
  font-size: .82rem;
  color: var(--grey-soft);
}

.footer p { margin: .4em 0; }
.footer a { color: var(--navy); }

/* The first tester row of a block is the mandatory one and cannot be
   removed. Its button stays in the layout with visibility rather than
   display, so every input in the block keeps the same width - and it is
   right without JavaScript as well. */
.tester-row:first-child .js-del { visibility: hidden; }

/* ---------------- File selection ---------------- */

/* The native control is taken out of sight but stays in the document, so
   its label keeps working and it remains reachable by keyboard. Not
   display:none, which would drop it out of the tab order entirely. */
.is-offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.btn-add-files {
  background: var(--tint);
  border: 1.5px dashed var(--line);
  color: var(--navy);
  padding: 11px 18px;
  font-weight: 600;
}

.btn-add-files:hover {
  border-color: var(--orange);
  border-style: solid;
  color: var(--orange);
}

/* The files chosen so far. Shown rather than merely counted: a list that
   silently grows would be as opaque as one that silently resets. */
.files-list { margin-top: 10px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 6px;
  background: var(--tint);
  border-radius: 4px;
  font-size: .88rem;
}

.file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
  font-weight: 600;
}

.file-size { flex: 0 0 auto; color: var(--grey-soft); font-size: .85em; }

.btn-icon-sm {
  width: 30px;
  height: 30px;
  font-size: 1.05rem;
}
