/* The sign-in page: a white card over a pink island (island.js draws the island).
   It stands alone, apart from app.css: the dashboard is a work tool, this is the
   front door. Nothing inline (the CSP forbids it). */

:root {
  --pink: #ef1a86;          /* the pink of the Lovely logo */
  --pink-press: #e0117b;    /* deep enough for white text on it (4.6 to 1) */
  --pink-deep: #c40e6c;
  --plum: #4a0a2e;
  --plum-soft: #7a2e55;
  --blush: #fff5f9;
  --petal: #f4bcd6;
  --danger: #b42318;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  /* The logo is set in a geometric sans: the nearest one each system carries. */
  --display: Futura, "Century Gothic", "Avenir Next", Avenir, "URW Gothic", var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--plum);
  /* What shows before the island has loaded, and for good if it cannot draw:
     the same sky over the same sea. */
  background: linear-gradient(180deg, #e3127c 0%, #ef1a86 26%, #f5469d 43.8%, #de1179 44%, #c40e6c 72%, #ad0c60 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

h1, p { margin: 0; }
button, input { font: inherit; color: inherit; }

/* ---- the island ----------------------------------------------------------- */

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.scene.ready { opacity: 1; }

/* A soft darkening toward the corners, so the eye rests on the island and the card. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 95% at 42% 42%, rgba(94, 10, 58, 0) 52%, rgba(94, 10, 58, 0.3) 100%);
}

/* ---- the brand, white on pink as in the logo ------------------------------ */

.lockup {
  position: fixed;
  z-index: 2;
  top: max(26px, env(safe-area-inset-top));
  left: max(30px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  filter: drop-shadow(0 2px 10px rgba(110, 8, 62, 0.35));
  pointer-events: none;
  user-select: none;
}
.mark { width: 46px; height: 46px; flex: none; }
.wordmark {
  display: inline-flex;
  flex-direction: column;
  font-family: var(--display);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}
.wordmark b {
  margin-right: -0.3em;       /* the spacing after the last letter is not part of the word */
  font-size: 21px;
  font-weight: inherit;
  letter-spacing: 0.3em;
}
/* The second line is spread to exactly the width of the first, whatever the font. */
.wordmark small {
  display: flex;
  justify-content: space-between;
  width: 0;
  min-width: 100%;
  margin-top: 7px;
  font-size: 9.5px;
  opacity: 0.92;
}
.wordmark i { font-style: normal; }

/* ---- the card ------------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  justify-items: end;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px clamp(28px, 8vw, 132px);
}

.card {
  width: 100%;
  max-width: 388px;
  padding: 38px 36px 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 34px 70px -24px rgba(94, 10, 58, 0.6), 0 10px 26px -10px rgba(94, 10, 58, 0.3);
  animation: arrive 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.card h1 { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.card .lede { margin: 6px 0 22px; color: var(--plum-soft); }

.card label {
  display: block;
  margin: 16px 0 7px;
  color: var(--plum-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.field {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1.5px solid var(--petal);
  border-radius: 14px;
  background: var(--blush);
  font-size: 16px;            /* 16px keeps iOS from zooming in on focus */
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field:hover { border-color: #ee9cc3; }
.field:focus-visible {
  border-color: var(--pink);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(239, 26, 134, 0.18);
}
.field::selection { background: rgba(239, 26, 134, 0.24); }
/* Chrome paints saved logins pale blue; keep them in the page's colours. */
.field:-webkit-autofill,
.field:-webkit-autofill:hover,
.field:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--plum);
  -webkit-box-shadow: 0 0 0 100px var(--blush) inset;
  caret-color: var(--plum);
}
.field:-webkit-autofill:focus-visible {
  -webkit-box-shadow: 0 0 0 100px #fff inset, 0 0 0 4px rgba(239, 26, 134, 0.18);
}

.go {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: 26px;
  border: 0;
  border-radius: 14px;
  background: var(--pink-press);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 22px -10px rgba(224, 17, 123, 0.75);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.go:hover { background: var(--pink-deep); }
.go:active { transform: translateY(1px); box-shadow: 0 6px 14px -8px rgba(224, 17, 123, 0.75); }
.go:focus-visible { outline: 3px solid rgba(239, 26, 134, 0.35); outline-offset: 3px; }
.go:disabled { opacity: 0.6; cursor: progress; }

.error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}

/* ---- phones, and tablets held upright: the island above, the card below ---- */

@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait) {
  .lockup { top: max(18px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); gap: 10px; }
  .mark { width: 38px; height: 38px; }
  .wordmark b { font-size: 17px; }
  .wordmark small { margin-top: 6px; font-size: 8px; }

  .stage {
    align-items: end;
    justify-items: center;
    padding: 16px 14px max(14px, env(safe-area-inset-bottom));
  }
  .card { max-width: 440px; padding: 26px 22px 6px; border-radius: 24px; }
  .card h1 { font-size: 24px; }
  .card .lede { margin-bottom: 14px; }
  .card label { margin-top: 13px; }
  .go { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .scene { transition: none; }
  .field, .go { transition: none; }
}
