/* Lofa. Business Lolland-Falsters designmanual 2022: mørkegrøn, mint og sand. */
:root {
  --fjord: #0c4431;
  --dyb: #082e21;
  --dis: #CBE6E1;
  --dis-svag: rgba(203, 230, 225, .6);
  --morgen: #E2D788;
  --hvid: #ffffff;
  --fejl: #ffad9c;
  --serif: 'Libre Caslon Text', 'Miller Display', Georgia, serif;
  --sans: 'Zen Kaku Gothic New', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --panel-bredde: 460px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--dyb);
  color: var(--hvid);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Fotoet fylder hele skærmen bag panelet */
.billede {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  animation: aabn 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
.billede::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 46, 33, .55) 0%, rgba(8, 46, 33, 0) 55%);
}

@keyframes aabn {
  from { transform: scale(1.06); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Panelet er en søjle i fjordens farve, fra top til bund */
.top, .panel {
  position: relative;
  width: var(--panel-bredde);
  padding-left: 56px;
  padding-right: 56px;
  background: var(--fjord);
}

.top {
  padding-top: 48px;
  padding-bottom: 0;
}

.logo {
  display: block;
  width: 200px;
  height: auto;
}

.panel {
  min-height: calc(100vh - 89px);
  padding-top: 18vh;
  padding-bottom: 96px;
}

.navn {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 7.5rem;
  line-height: .9;
  letter-spacing: -.035em;
  font-variation-settings: 'opsz' 72;
}

.intro {
  margin: 20px 0 48px;
  max-width: 30ch;
  color: var(--dis);
  font-size: 1.0625rem;
}

.label {
  display: block;
  margin-bottom: 12px;
  color: var(--dis);
  font-size: .875rem;
  font-weight: 500;
}

/* Ét rigtigt inputfelt, lagt usynligt oven på seks tegnede pladser */
.felter {
  position: relative;
  height: 76px;
}

.kode {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px; /* undgår zoom på iOS */
  outline: none;
  cursor: text;
}

.celler {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  height: 100%;
}

.celler span {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--dis-svag);
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  transition: border-color .15s ease;
}

.celler span.udfyldt { border-bottom-color: var(--dis); }

.celler span.aktiv {
  border-bottom-color: var(--morgen);
}
.celler span.aktiv:empty::after {
  content: '';
  width: 2px;
  height: 2.4rem;
  background: var(--morgen);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.felter.fejl .celler span { border-bottom-color: var(--fejl); }
.felter.fejl { animation: ryst .35s ease; }

@keyframes ryst {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.besked {
  min-height: 1.5em;
  margin: 14px 0 28px;
  color: var(--fejl);
  font-size: .9375rem;
}

.knap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 2px;
  background: var(--hvid);
  color: var(--fjord);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease;
}
.knap:hover { background: var(--morgen); }
.knap:focus-visible {
  outline: 2px solid var(--morgen);
  outline-offset: 4px;
}

.knap.sekundaer {
  width: auto;
  padding: 0 28px;
  background: transparent;
  color: var(--hvid);
  box-shadow: inset 0 0 0 1px var(--dis-svag);
}
.knap.sekundaer:hover { background: rgba(255, 255, 255, .08); }

.status {
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
  color: var(--dis);
}
.status li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(203, 230, 225, .15);
}
.prik {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8fd19e;
}
.prik.vent { background: var(--morgen); }

.kredit {
  position: fixed;
  right: 24px;
  bottom: 18px;
  color: rgba(255, 255, 255, .8);
  font-size: .8125rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}

/* Telefon: fotoet øverst, panelet nedenunder */
@media (max-width: 760px) {
  body { background: var(--fjord); }
  .billede {
    position: relative;
    height: 34vh;
    min-height: 220px;
  }
  .billede::after {
    background: linear-gradient(180deg, rgba(8, 46, 33, 0) 50%, var(--fjord) 100%);
  }
  .top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 16px 0;
    background: transparent;
  }
  .logo { width: 150px; }
  .panel {
    width: 100%;
    min-height: 0;
    padding: 28px 16px 64px;
  }
  .navn { font-size: 5rem; }
  .intro { margin-bottom: 36px; }
  .celler { gap: 8px; }
  .celler span { font-size: 2.5rem; }
  .kredit {
    position: absolute;
    top: calc(34vh - 28px);
    right: 16px;
    bottom: auto;
  }
}

@media (max-width: 760px) and (max-height: 640px) {
  .billede { height: 24vh; min-height: 150px; }
  .kredit { top: calc(max(24vh, 150px) - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  .billede, .felter.fejl, .celler span.aktiv:empty::after { animation: none; }
}
