/* Meal Delivery Photos - built for phones first: big text, big buttons, strong contrast for outdoors.
   Colours and lettering follow the Aishel House logo: teal and tan, with rounded letters. */

/* Quicksand Bold: the rounded lettering for headings and buttons (free font, licence in /fonts/OFL.txt). */
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/quicksand-700.woff2") format("woff2");
}

:root {
  --teal: #317c98;        /* the logo's teal */
  --teal-dark: #25647c;
  --teal-tint: #e7f1f5;
  --tan: #ba9771;         /* the logo's tan. Decoration only: it is too pale for text. */
  --round: "Quicksand", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #111111;
  --ink-soft: #3b3b3b;
  --paper: #ffffff;
  --line: #6b6b6b;
  --error-ink: #8c0f1f;
  --error-bg: #fdecee;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 19px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Each screen fills the phone, with the main button near the thumb. */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
}

.fill {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.center {
  align-items: center;
  text-align: center;
}

.bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding-top: 20px;
}

h1 {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-family: var(--round);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
}

h1:focus { outline: none; }

.lead {
  margin: 0 0 20px;
  font-size: 20px;
  color: var(--ink-soft);
}

.top {
  margin: 8px 0 8px;
  text-align: center;
}

.logo {
  display: block;
  width: 210px;
  max-width: 62%;
  height: auto;
  margin: 0 auto;
}

/* The short tan line under the logo. */
.rule {
  width: 64px;
  height: 4px;
  margin: 18px auto 16px;
  border-radius: 2px;
  background: var(--tan);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Text boxes */
.field { display: block; }

.label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--round);
  font-size: 18px;
  font-weight: 700;
}

.optional {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  color: var(--ink-soft);
}

input[type="text"] {
  display: block;
  width: 100%;
  height: 60px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 22px; /* 16px or more also stops iPhones zooming in on tap */
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(49, 124, 152, 0.35);
  outline-offset: 1px;
}

input::placeholder { color: #767676; }

/* PIN digits show as dots */
.pin {
  -webkit-text-security: disc;
  letter-spacing: 0.25em;
}

/* Buttons */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 20px;
  border: 2px solid transparent;
  border-radius: 18px;
  font: inherit;
  font-family: var(--round);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.button.huge {
  min-height: 84px;
  font-size: 25px;
}

.button.primary {
  background: var(--teal);
  color: #fff;
}

.button.primary:active { background: var(--teal-dark); }

.button.secondary {
  background: #fff;
  border-color: var(--teal);
  color: var(--teal-dark);
}

.button.secondary:active { background: var(--teal-tint); }

.button:focus-visible,
.link:focus-visible {
  outline: 4px solid #111;
  outline-offset: 3px;
}

.button[disabled],
.button.disabled {
  background: var(--teal-dark);
  border-color: transparent;
  color: #fff;
  cursor: default;
  pointer-events: none;
}

.button.secondary.disabled {
  background: #fff;
  border-color: #9a9a9a;
  color: #6b6b6b;
}

.icon {
  fill-rule: evenodd;
  width: 34px;
  height: 34px;
  flex: none;
  fill: currentColor;
}

.spinner {
  width: 26px;
  height: 26px;
  flex: none;
  border: 4px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.5s; }
}

.link {
  min-height: 48px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--teal-dark);
  font: inherit;
  font-family: var(--round);
  font-size: 18px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* Messages */
.message {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 19px;
  font-weight: 600;
}

.message.error {
  background: var(--error-bg);
  border: 2px solid var(--error-ink);
  color: var(--error-ink);
}

.hint {
  margin: 20px 0 0;
  font-size: 17px;
  color: var(--ink-soft);
}

/* Photo screen */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--tan);
}

.who {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
}

#preview {
  display: block;
  max-width: 100%;
  max-height: 42vh;
  max-height: 42dvh;
  object-fit: contain;
}

#photo-ready .message { margin-top: 16px; }
#photo-empty h1 { margin-top: 12px; }

/* Sent screen */
.tick {
  width: 112px;
  height: 112px;
  margin: 12vh 0 20px;
}

.tick circle {
  fill: var(--teal);
  stroke: var(--tan);
  stroke-width: 5;
}

.tick path {
  fill: none;
  stroke: #fff;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#screen-sent h1 { font-size: 44px; }
