/* Standalone sign-in page. Keep account and sailing-search styles in styles.css. */
:root {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  --ink: #18212f;
  --muted: #657184;
  --line: #c8d6d6;
  --panel: #f5f8f6;
  --paper: #edf3f1;
  --control: #fbfcfa;
  --subtle-line: #e3ebe9;
  --floating-panel: rgba(245, 248, 246, 0.98);
  --navy: #122033;
  --teal: #166f76;
  --on-teal: #fff;
  --coral: #b85544;
  --gold: #b88835;
  --focus-ring: rgba(22, 111, 118, 0.25);
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6edf1;
  --muted: #a9b8bf;
  --line: #334c55;
  --panel: #12232a;
  --paper: #0d1a20;
  --control: #102128;
  --subtle-line: #263d45;
  --floating-panel: rgba(18, 35, 42, 0.98);
  --navy: #081117;
  --teal: #63c6c2;
  --on-teal: #06171b;
  --coral: #e08a78;
  --gold: #d8ad61;
  --focus-ring: rgba(99, 198, 194, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  overscroll-behavior-x: none;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  letter-spacing: 0;
}

.masthead {
  --masthead-edge-x: clamp(18px, 4vw, 52px);
  --masthead-edge-left: max(var(--masthead-edge-x), var(--safe-area-left));
  --masthead-edge-right: max(var(--masthead-edge-x), var(--safe-area-right));
  --masthead-top-edge: max(18px, var(--safe-area-top));
  --top-actions-gap: 10px;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--navy);
  color: #fff;
}

.masthead__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.masthead__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  -webkit-user-drag: none;
}

.masthead__image--backdrop {
  display: none;
  z-index: 0;
  filter: blur(9px) saturate(1.08);
  opacity: 0.9;
  transform: scale(1.08);
}

.masthead__image--ship {
  z-index: 1;
}

.masthead__shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(11, 19, 31, 0.92), rgba(11, 19, 31, 0.5) 48%, rgba(11, 19, 31, 0.28));
}

.masthead__top-actions {
  position: absolute;
  top: var(--masthead-top-edge);
  right: var(--masthead-edge-right);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--top-actions-gap);
}

.masthead__site-title {
  position: absolute;
  top: var(--masthead-top-edge);
  left: var(--masthead-edge-left);
  z-index: 1;
  max-width: calc(100% - var(--masthead-edge-left) - var(--masthead-edge-right) - 104px);
  overflow: hidden;
  padding-bottom: 0.08em;
  color: #fff;
  font-size: clamp(1.25rem, 2.1vw, 2rem);
  font-weight: 900;
  line-height: 1.12;
  text-overflow: ellipsis;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.44);
  white-space: nowrap;
}

.support-menu {
  position: relative;
  flex: 0 0 auto;
}

.support-menu__button,
.theme-toggle-button {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(11, 19, 31, 0.46);
  color: rgba(255, 255, 255, 0.86);
  line-height: 1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
  -webkit-user-select: none;
  user-select: none;
}

.support-menu__button:hover,
.support-menu__button[aria-expanded="true"],
.theme-toggle-button:hover {
  background: rgba(11, 19, 31, 0.62);
  color: #fff;
}

.support-menu__button:focus-visible,
.theme-toggle-button:focus-visible {
  outline-color: #63c6c2;
}

.support-menu__icon,
.theme-toggle-button__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 55%;
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.support-menu__icon {
  width: 58%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-menu__icon-dot {
  fill: currentColor;
  stroke: none;
}

.theme-toggle-button__moon {
  fill: currentColor;
}

.theme-toggle-button__sun {
  display: none;
  fill: currentColor;
}

.theme-toggle-button__sun path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.75;
}

:root[data-theme="dark"] .theme-toggle-button__moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-button__sun {
  display: inline;
}

.support-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 6px;
  /* Leave room for the theme button to the right of this anchor. */
  width: min(360px, calc(100vw - var(--masthead-edge-right) - 42px - var(--top-actions-gap) - max(12px, var(--safe-area-left))));
  max-height: calc(100vh - var(--masthead-top-edge) - 62px);
  max-height: calc(100dvh - var(--masthead-top-edge) - 62px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: var(--floating-panel);
  color: var(--ink);
  box-shadow: 0 18px 45px rgba(11, 19, 31, 0.24);
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.support-menu__lead {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.support-menu__note,
.support-menu__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.support-menu__link {
  justify-self: start;
  max-width: 100%;
  margin: 2px 0;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control);
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.support-menu__link:hover,
.support-menu__link:focus-visible {
  border-color: var(--teal);
  text-decoration: underline;
}

.auth-screen {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(76px, calc(var(--safe-area-top) + 58px))
    max(20px, var(--safe-area-right)) max(36px, var(--safe-area-bottom))
    max(20px, var(--safe-area-left));
  pointer-events: none;
}

.auth-panel {
  display: grid;
  gap: 28px;
  width: min(760px, 100%);
  padding: 28px 36px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px) saturate(1.04);
  -webkit-backdrop-filter: blur(5px) saturate(1.04);
  pointer-events: auto;
  color: var(--ink);
}

.auth-panel__intro {
  text-align: center;
}

.auth-panel__logo {
  display: block;
  width: 144px;
  height: 144px;
  margin: 0 auto 14px;
  border-radius: 50%;
}

.auth-panel__site {
  margin: 0;
  font-size: clamp(1.12rem, 2.2vw, 1.42rem);
  font-weight: 900;
  line-height: 1.12;
}

.auth-panel__intro p {
  max-width: 600px;
  margin: 12px auto 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel__sections {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
}

.auth-panel__sections::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 28px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: var(--teal);
}

.auth-panel__login {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.auth-panel__title {
  display: grid;
  gap: 2px;
  margin: 0 0 2px;
}

.auth-panel__mode {
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.35;
}

.auth-panel__guest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.auth-panel__guest h2 {
  margin: 0;
  font-size: 1.12rem;
}

.auth-panel__guest p {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel__guest p span {
  display: block;
  margin-top: 8px;
}

.field {
  position: relative;
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: 0.5625rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.field > input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 2.1rem;
  min-height: 2.1rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--control);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.field > input:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: none;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 2px;
}

.ghost-button,
.primary-button {
  min-height: 2.25rem;
  padding: 0 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
}

.ghost-button {
  border-color: var(--line);
  background: var(--control);
  color: var(--ink);
}

.primary-button {
  width: 100%;
  background: var(--teal);
  color: var(--on-teal);
}

.auth-actions .ghost-button,
.auth-actions .primary-button {
  min-height: 2.1rem;
}

.text-button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 900;
}

.text-button:hover {
  color: var(--ink);
}

.auth-actions #auth-reset {
  grid-column: 1;
  justify-self: start;
}

button:disabled {
  cursor: not-allowed;
}

.ghost-button:disabled {
  border-color: var(--subtle-line);
  background: color-mix(in srgb, var(--control) 60%, transparent);
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  opacity: 0.58;
}

.primary-button:disabled {
  background: #94a3ad;
}

.text-button:disabled {
  opacity: 0.58;
}

.auth-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.auth-status[data-tone="error"] {
  color: var(--coral);
}

.auth-panel__guest .auth-status {
  margin: 8px 0 0;
}

.auth-panel__guest .auth-status:empty {
  display: none;
}

@media (min-width: 1181px) {
  .masthead__image--backdrop {
    display: block;
  }

  .masthead__image--ship {
    object-fit: contain;
  }
}

@media (max-width: 680px) {
  .masthead {
    --masthead-edge-x: 12px;
    --masthead-top-edge: max(12px, var(--safe-area-top));
    --top-actions-gap: 6px;
  }

  .masthead__site-title {
    font-size: clamp(1rem, 4.3vw, 1.1rem);
  }
}

@media (max-width: 600px) {
  .auth-screen {
    padding: max(72px, calc(var(--safe-area-top) + 58px))
      max(16px, var(--safe-area-right)) max(24px, var(--safe-area-bottom))
      max(16px, var(--safe-area-left));
  }

  .auth-panel {
    padding: 22px;
    gap: 24px;
  }

  .auth-panel__logo {
    width: 112px;
    height: 112px;
  }

  .auth-panel__sections {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .auth-panel__sections::before {
    display: none;
  }

  .auth-panel__guest {
    border-top: 3px solid var(--teal);
    padding-top: 24px;
  }
}
