/*
 * Pages reached from a phone rather than from the frame: the login screen and
 * the admin section. These scroll and are laid out for a narrower screen.
 */

/* Login ---------------------------------------------------------------- */

.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login__card {
  width: 100%;
  max-width: 22rem;
}

/* Admin shell ----------------------------------------------------------- */

.admin {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.admin-nav__back {
  margin-left: auto;
}

/* Forms ----------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Each group of settings is a card, titled like the status cards below it. The
   fieldset holds neither the background nor the padding: Chrome carves the
   legend out of a fieldset's own background and lays it out above the
   fieldset's padding, so a fieldset that is the card puts its title outside
   the card. The card and its body sit around it instead. The fields then get
   their own flex box, because a fieldset lays its legend out specially and
   flex does not account for it. */
.form__group {
  margin: 0;
  padding: 0;
  border: 0;
}

.form__legend {
  padding: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: rgba(var(--content-rgb), 0.6);
}

.form__fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form__actions {
  display: flex;
  gap: 0.75rem;
}

.form__hint {
  font-size: 1rem;
  color: rgba(var(--content-rgb), 0.5);
}

.narrow {
  max-width: 42rem;
}

/* Calendar feeds --------------------------------------------------------- */

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feed__url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  color: rgba(var(--content-rgb), 0.5);
}

.feed__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  font-size: 1.125rem;
  color: rgba(var(--content-rgb), 0.6);
}

.feed__actions {
  display: flex;
  flex: none;
  gap: 0.5rem;
}

/* Photo grid -------------------------------------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* padding-top holds the 4:3 box, because aspect-ratio needs a newer engine
   than the frame's WebView has. */
.photo-tile {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  padding-top: 75%;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-box);
  background-color: var(--surface-alt);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.photo-tile img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Upload ------------------------------------------------------------------ */

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-list:empty {
  display: none;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
}

.upload-row__name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-row__state {
  flex: none;
  width: 6rem;
  text-align: right;
  color: rgba(var(--content-rgb), 0.6);
}

/* Waste address search --------------------------------------------------- */

/* RenoWeb answers with the property and land-registry numbers appended, which
   are long and never what the eye is looking for; the street is at the front. */
.address {
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.address__pick {
  flex: none;
}

/* The same pictograms the frame draws, at a size for a phone held in the hand
   rather than a screen read from a metre away. */
.waste-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.waste-preview .waste__pictogram {
  width: 3rem;
}

.waste-preview .waste__label {
  color: rgba(var(--content-rgb), 0.6);
}
