/* Build a Property Website
   RIZE Property page builder

   Colours and type are the RIZE brand kit, the same set the property pages use.

   Built for a phone held in one hand in a driveway. Nothing here asks anyone to
   write anything. Every screen is taps, a number, or a date. Portrait first,
   widens once at 720px. */


/* Fonts
   ------------------------------------------------------------------------ */

@font-face {
  font-family: "Ivy Mode";
  src: url("../fonts/IvyMode-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Questrial";
  src: url("../fonts/Questrial-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* Tokens
   ------------------------------------------------------------------------ */

:root {
  --black: #010101;
  --charcoal: #1a1a1c;
  --line: #232326;
  --rule: #efefef;
  --box: #d7d3cc;
  --label: #6f6a61;
  --stone: #ccc8c0;
  --offwhite: #f8f8f8;
  --white: #ffffff;
  --text: #333333;
  --orange: #f08419;

  --font-display: "Ivy Mode", Georgia, "Times New Roman", serif;
  --font-body: "Questrial", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --gutter: 22px;
  --bar: 64px;

  /* Nothing on this page is smaller than a thumb. */
  --tap: 56px;
}


/* Base
   ------------------------------------------------------------------------ */

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--white);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

/* Every question sits centred over whatever it is asking about. The answers
   below it stay left, because a list of ticks read down an edge is faster than
   a list of ticks read down a centre line. */
h1,
h2,
.lead,
.hint {
  text-align: center;
}

h1,
h2 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  color: var(--black);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.1rem, 9vw, 3rem);
}

h2 {
  font-size: clamp(1.75rem, 7.5vw, 2.5rem);
}

.lead {
  margin: 0 0 14px;
  font-size: 1.0625rem;
  color: var(--text);
}

.hint {
  margin: -12px 0 26px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
}


/* Top and bottom bars
   ------------------------------------------------------------------------ */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--bar);
  background: var(--black);
  display: flex;
  align-items: center;
}

.bar--top {
  top: 0;
  padding-inline: var(--gutter);
  justify-content: flex-start;
}

.bar--bottom {
  bottom: 0;
  border-top: 1px solid var(--line);
  /* Sits above the home indicator on iPhones. */
  height: calc(var(--bar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}

.bar__logo {
  display: block;
  height: 30px;
  width: auto;
}

/* One thin line across the top of the page is the whole progress display.
   A step counter would just be another number to read. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--line);
}

.progress__fill {
  height: 100%;
  width: 0;
  background: var(--orange);
  transition: width 0.3s ease;
}


/* Screens
   ------------------------------------------------------------------------ */

.screen {
  display: none;
  min-height: 100dvh;
  padding: calc(var(--bar) + 40px) var(--gutter) calc(var(--bar) + 40px);
}

.screen.is-active {
  display: flex;
  align-items: center;
}

/* The pick list runs well past the bottom of a phone, so it starts at the top
   instead of being centred. */
.screen--list.is-active {
  align-items: flex-start;
}

.screen__inner {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}


/* Text fields
   ------------------------------------------------------------------------ */

.field {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  background: var(--offwhite);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.4;
  color: var(--black);
  appearance: none;
}

.field--tight {
  margin-top: 12px;
}

.field::placeholder {
  color: #a5a29c;
}

.field:focus {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  background: var(--white);
}


/* Tiles, for the price method
   ------------------------------------------------------------------------ */

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tiles--wide {
  grid-template-columns: 1fr;
}

.tile {
  min-height: var(--tap);
  padding: 14px 16px;
  background: var(--offwhite);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--black);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tile.is-on {
  background: var(--orange);
  border-color: var(--orange);
}


/* The pick list
   ------------------------------------------------------------------------ */

/* Media, the property, the features. Three labels are enough to stop a list
   this long reading as one undifferentiated scroll. */
.group {
  margin: 30px 0 10px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
}

.group:first-child {
  margin-top: 0;
}

.rows {
  display: grid;
  gap: 8px;
}

/* Each row is one section of the finished page. The tick says what is in, and
   the orange says it again from across the screen. */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  background: var(--offwhite);
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.row.is-on {
  background: var(--orange);
  border-color: var(--orange);
}

.row__text {
  flex: 1;
}

.row__name {
  display: block;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--black);
}

/* What actually goes in the section, so nobody has to guess from the name. */
.row__note {
  display: block;
  margin-top: 1px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--label);
}

.row.is-on .row__note {
  color: rgba(1, 1, 1, 0.62);
}

.row__box {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  background: var(--white);
  border: 1px solid var(--box);
  border-radius: 5px;
}

.row.is-on .row__box {
  background: var(--black);
  border-color: var(--black);
}

.row.is-on .row__box::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.add {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.add .field {
  flex: 1;
}

.add__btn {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  background: var(--offwhite);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
  color: var(--black);
  cursor: pointer;
}


/* Steppers
   ------------------------------------------------------------------------ */

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.stepper__label {
  flex: 1;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
}

.stepper__btn {
  width: var(--tap);
  height: var(--tap);
  background: var(--offwhite);
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--black);
  cursor: pointer;
}

.stepper__btn:active {
  background: var(--rule);
}

.stepper__value {
  width: 34px;
  font-family: var(--font-label);
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  text-align: center;
}


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

.button {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: 14px;
  padding: 18px 28px 16px;
  background: var(--orange);
  border: 0;
  border-radius: 50px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--black);
  cursor: pointer;
}

.button--quiet {
  background: transparent;
  color: var(--label);
}


/* Back and Next
   ------------------------------------------------------------------------ */

.nav {
  height: 100%;
  padding-inline: var(--gutter);
  background: transparent;
  border: 0;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav--back {
  color: var(--stone);
}

.nav--next {
  margin-left: auto;
  color: var(--orange);
}

.nav[hidden] {
  display: none;
}


/* Wider than a phone
   ------------------------------------------------------------------------ */

@media (min-width: 720px) {
  body {
    font-size: 18px;
  }

  .tiles {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .tiles--wide {
    grid-template-columns: 1fr 1fr;
  }
}


@media (prefers-reduced-motion: reduce) {
  .progress__fill {
    transition: none;
  }
}
