/*
 * The front door of a white-label deployment (layouts/door.phtml).
 *
 * One surface, the product's own slate — the colour of the bar and of the tab
 * icon — so the step from this page into the CRM is not a change of world.
 *
 * Every pairing here was computed (WCAG relative luminance), not eyeballed —
 * the first draft of this comment was written from memory and two of its six
 * figures were wrong:
 *   #CBD5E1 on #1E293B   9.85:1   the label
 *   #94A3B8 on #1E293B   5.71:1   the hint and the footer
 *   #FDA4AF on #1E293B   7.74:1   the error
 *   #0F172A on #0EA5E9   6.44:1   the button — NOT white, which is 2.77:1
 *   #0F172A on #38BDF8   8.33:1   the button, hovered
 *   #64748B on #FFFFFF   4.76:1   the placeholder, the lightest that passes
 *   #334155 on #FFFFFF  10.35:1   the domain suffix
 *
 * The placeholder and the suffix are deliberately far apart. At #64748B and
 * #475569 they measured as different colours and read, at a glance, as one
 * grey address: nobody could tell which half was theirs to type. The fixed
 * half is now solid and the example a ghost, so the blank is the obvious part.
 */

:root {
  --dr-ground:  #1E293B;
  --dr-ink:     #0F172A;
  --dr-sky:     #0EA5E9;
  --dr-sky-hi:  #38BDF8;
  --dr-deep:    #0369A1;
  --dr-label:   #CBD5E1;
  --dr-muted:   #94A3B8;
  --dr-error:   #FDA4AF;
  --dr-field:   #FFFFFF;
  --dr-hint-in: #64748B;
  --dr-suffix:  #334155;
  --dr-ease:    cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { height: 100%; }

body.dr {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--dr-ground);
  color: var(--dr-label);
  font: 400 15px/1.5 Inter, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--dr-sky); color: var(--dr-ink); }

/* ── The middle ─────────────────────────────────────────────────────────── */

.dr-main {
  display: grid;
  justify-items: center;
  align-content: center;
  /* Optically centred: a block of logo-over-field reads low when it sits on
     the true middle, because the eye weighs the logo and not the field. */
  padding: 48px 16px 9vh;
}

.dr-logo {
  margin: 0 0 56px;
  line-height: 0;
  animation: dr-arrive 900ms var(--dr-ease) both;
}

.dr-logo img {
  display: block;
  height: 56px;
  width: auto;
}

@keyframes dr-arrive {
  from { opacity: .35; transform: translateY(8px); filter: blur(2px); }
  to   { opacity: 1;   transform: none;            filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dr-logo { animation: none; }
}

/* ── The way in ─────────────────────────────────────────────────────────── */

.dr-form {
  width: min(440px, 100%);
}

.dr-label {
  display: block;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dr-label);
}

/* Field and button are one control: the name, the domain it lives under, and
   the action, read left to right as the address they are building. */
.dr-control {
  display: flex;
  border-radius: 10px;
  background: var(--dr-field);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .4), 0 8px 24px -8px rgba(15, 23, 42, .55);
  transition: box-shadow 200ms var(--dr-ease);
}

.dr-control:focus-within {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .45), 0 8px 24px -8px rgba(15, 23, 42, .55);
}

.dr-control.is-invalid {
  box-shadow: 0 0 0 2px var(--dr-error), 0 8px 24px -8px rgba(15, 23, 42, .55);
}

.dr-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  padding: 0 4px 0 16px;
  cursor: text;
}

.dr-field input {
  flex: 1 1 auto;
  min-width: 3ch;
  width: 100%;
  padding: 15px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 16px/1.25 Inter, -apple-system, "Segoe UI", sans-serif;   /* 16px: anything smaller and iOS zooms in */
  color: var(--dr-ink);
  caret-color: var(--dr-deep);
  text-align: right;
}

.dr-field input::placeholder { color: var(--dr-hint-in); opacity: 1; }

.dr-suffix {
  flex: 0 0 auto;
  font: 500 16px/1.25 Inter, -apple-system, "Segoe UI", sans-serif;
  color: var(--dr-suffix);
  white-space: nowrap;
  padding: 15px 0;
}

.dr-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 5px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: var(--dr-sky);
  color: var(--dr-ink);
  font: 600 15px/1 Inter, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: background-color 160ms var(--dr-ease);
}

.dr-go i { font-size: 16px; transition: transform 220ms var(--dr-ease); }
.dr-go:hover { background: var(--dr-sky-hi); }
.dr-go:hover i { transform: translateX(3px); }
.dr-go:active { background: var(--dr-sky); }

.dr-go:focus-visible {
  outline: 2px solid var(--dr-ink);
  outline-offset: -4px;
}

.dr-note {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--dr-muted);
}

.dr-note.is-error {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--dr-error);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.dr-foot {
  padding: 0 16px 28px;
  text-align: center;
  font-size: 12.5px;
  color: var(--dr-muted);
}

/* ── Phones ─────────────────────────────────────────────────────────────── */

/* The domain is half the width of a phone. Under ~420px the field, the domain
   and the button no longer share a line with room to type, so the button drops
   below and the field keeps the whole width. */
@media (max-width: 440px) {
  .dr-main { padding-bottom: 6vh; }
  .dr-logo { margin-bottom: 44px; }
  .dr-logo img { height: 48px; }

  .dr-control { flex-direction: column; }
  .dr-field { padding-right: 16px; }
  .dr-suffix { font-size: 15px; }
  .dr-go {
    justify-content: center;
    padding: 14px 18px;
    margin: 0 5px 5px;
  }
}
