/*
 * Shared account/product surface styling for app.trynem.com.
 *
 * This surface is intentionally static and small: no remote fonts, analytics,
 * or framework bundle. The design mirrors the app handoff mocks while keeping
 * the operational pages quick to load from email, SMS and browser redirects.
 */

:root {
  color-scheme: light;
  --page: #f5f5f2;
  --panel: rgba(255, 255, 253, 0.90);
  --panel-strong: rgba(255, 255, 253, 0.97);
  --ink: #181816;
  --muted: #77746d;
  --muted-strong: #4f4d46;
  --line: rgba(24, 24, 22, 0.10);
  --line-strong: rgba(24, 24, 22, 0.18);
  --field: rgba(255, 255, 253, 0.82);
  --field-focus: #ffffff;
  --accent: #050608;
  --accent-2: #15171c;
  --accent-text: #ffffff;
  --positive: #10a241;
  --positive-soft: #ddf8e4;
  --danger: #b14a55;
  --danger-soft: #f0f2f8;
  --blue: #66645d;
  --shadow-card: 0 24px 68px rgba(24, 24, 20, 0.08);
  --shadow-button: none;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(16px, 3vw, 34px);
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.48 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.route-home {
  height: 100vh;
  max-height: 100vh;
  padding-block: clamp(14px, 2.4vh, 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

body::before,
body::after {
  display: none;
}

a { color: inherit; }
button,
input { font: inherit; }

.app-top {
  width: min(100%, 1180px);
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.05rem, 1.55vw, 1.28rem);
  font-weight: 720;
  letter-spacing: 0;
}

.brand__mark {
  width: clamp(32px, 3vw, 40px);
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(7, 13, 40, 0.17));
}

.account-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 0.82rem;
  box-shadow: 0 12px 30px rgba(71, 97, 143, 0.08), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.account-pill::before {
  content: "E";
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8eefb;
  color: #1f2b50;
  font-weight: 680;
}

.account-pill::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.75;
}

.surface {
  width: min(100%, 1180px);
  min-height: calc(100vh - clamp(16px, 3vw, 34px) * 2 - 56px);
  margin: 0 auto;
  display: grid;
  position: relative;
}

.route-home .surface {
  flex: 1;
  min-height: 0;
}

.surface--center {
  place-items: center;
  padding: clamp(18px, 4vw, 54px) 0 clamp(16px, 3.5vw, 46px);
}

.surface--split {
  grid-template-columns: minmax(300px, 500px) 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  padding: clamp(14px, 3vh, 30px) 6vw clamp(12px, 2.4vh, 24px);
}

.surface--wide {
  align-items: start;
  padding: clamp(26px, 5vw, 56px) 7vw clamp(22px, 4vw, 48px);
}

.card {
  position: relative;
  width: min(100%, 500px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  text-align: left;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(115%);
}

.card--hero {
  padding: clamp(24px, 3.4vh, 38px) clamp(28px, 4vw, 44px) clamp(22px, 3vh, 32px);
}

.card--auth,
.card--setup,
.card--handoff,
.card--result {
  padding: clamp(26px, 4vw, 42px) clamp(24px, 4vw, 40px);
  text-align: center;
}

.card--wide {
  width: min(100%, 820px);
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

h1 {
  max-width: 11em;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(2.05rem, 4vw, 3.35rem);
  line-height: 0.96;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.card--auth h1,
.card--setup h1,
.card--handoff h1,
.card--result h1,
.card--wide h1 {
  max-width: none;
  font-size: clamp(1.72rem, 3vw, 2.36rem);
  letter-spacing: -0.04em;
}

.card--wide h1 {
  margin-bottom: 8px;
  text-align: left;
}

p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.25vw, 1.12rem);
  line-height: 1.38;
  letter-spacing: -0.01em;
}

.note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.state { display: block; }
.state > h1 + .note,
.state > h1 + p { margin-top: 4px; }

.ambient-line {
  justify-self: center;
  color: #6a78a0;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  line-height: 1.18;
  font-weight: 460;
  letter-spacing: -0.04em;
}

.actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 17px;
  border: 1px solid rgba(5, 6, 8, 0.92);
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 590;
  font-size: 0.96rem;
  letter-spacing: -0.015em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: transform 120ms ease, opacity 150ms ease, background 150ms ease;
}

.button:not(.button--quiet)::after {
  content: "→";
  margin-left: auto;
  font-size: 1.24rem;
  line-height: 0;
  font-weight: 340;
}

.button:hover { background: #2b2b27; box-shadow: none; }
.button:active { transform: scale(.98); }
.button:disabled { cursor: wait; opacity: 0.58; transform: none; }

.button--quiet {
  border-color: rgba(24, 31, 52, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 250, 255, 0.58));
  color: #101522;
  box-shadow: 0 10px 24px rgba(42, 60, 98, 0.08), 0 1px 0 rgba(255, 255, 255, 0.78) inset;
}

.button--quiet:hover {
  border-color: rgba(24, 31, 52, 0.24);
  box-shadow: 0 13px 28px rgba(42, 60, 98, 0.11), 0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.account-links {
  margin: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #56658f;
  font-size: 0.9rem;
  line-height: 1.3;
}

.account-links a {
  color: #121a31;
  font-weight: 560;
  text-decoration: none;
}

.account-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.utility-link,
.link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #466095;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 540;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.utility-link {
  margin-top: 22px;
  padding-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.utility-link::before {
  content: "";
  width: 18px;
  height: 18px;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 3px, #466095 3px 4.5px, transparent 5px),
    linear-gradient(#466095, #466095) center / 13px 2px no-repeat,
    linear-gradient(90deg, #466095, #466095) center / 2px 13px no-repeat;
  opacity: 0.9;
}

.button:focus-visible,
.link:focus-visible,
.utility-link:focus-visible,
.field:focus-visible,
.brand:focus-visible {
  outline: 3px solid rgba(93, 125, 239, 0.32);
  outline-offset: 4px;
}

.status-orb {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf2fb;
  color: var(--accent);
  box-shadow: 0 18px 40px rgba(64, 88, 140, 0.12), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.status-orb::before {
  content: "";
  width: 26px;
  height: 26px;
  display: block;
}

.status-orb--success {
  background: radial-gradient(circle, #c9efcd 0 42%, #eaf8ec 43% 100%);
  color: var(--positive);
}

.status-orb--success::before {
  width: 27px;
  height: 14px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg) translate(4px, -2px);
}

.status-orb--cancelled::before {
  background:
    linear-gradient(currentColor, currentColor) center / 30px 3px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 3px 30px no-repeat;
  transform: rotate(45deg);
}

.status-orb--decision {
  width: 88px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(225, 235, 255, 0.72));
}

.status-orb--decision::before {
  width: 38px;
  height: 46px;
  border: 2px solid rgba(116, 144, 214, 0.38);
  border-radius: 10px;
  background:
    linear-gradient(#7593ee, #7593ee) 12px 13px / 19px 3px no-repeat,
    linear-gradient(#a9baf4, #a9baf4) 12px 24px / 24px 2px no-repeat,
    linear-gradient(#c3cff7, #c3cff7) 12px 34px / 16px 2px no-repeat;
  box-shadow: 0 12px 28px rgba(93, 125, 239, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 860px) {
  body { padding: 14px; }
  body.route-home { padding-block: 12px; }
  .app-top { min-height: 48px; }
  .account-pill { display: none; }
  .surface {
    min-height: calc(100vh - 76px);
  }
  .surface--split {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 12px 0 14px;
  }
  .ambient-line {
    justify-self: start;
    padding-left: 4px;
    font-size: 1.36rem;
  }
  .surface--wide { padding: 20px 0 24px; }
  .card--hero,
  .card--auth,
  .card--setup,
  .card--handoff,
  .card--result {
    padding: 24px 18px;
  }
  .route-home .card--hero { padding: 20px 18px; }
  .brand__mark { width: 32px; }
  h1 { font-size: 2rem; }
}
