:root {
  --bg: #f6f6f4;
  --text: #161616;
  --muted: #686866;
  --line: #dededa;
  --panel-soft: #efefec;
  --brand-red: #f51f29;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body.login-body {
  position: relative;
  display: grid;
  min-height: 100vh;
  margin: 0;
  place-items: center;
  overflow: hidden;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(245, 31, 41, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff, var(--bg));
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff, var(--bg));
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 28px 16px;
}

.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-bg::before {
  position: absolute;
  inset: -18% -12%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1240' height='520' viewBox='0 0 1240 520'%3E%3Cpath d='M-90 360 C 160 205 335 438 600 292 S 975 180 1330 292' fill='none' stroke='%23f51f29' stroke-width='3' stroke-opacity='.24'/%3E%3Cpath d='M-90 410 C 168 266 355 482 620 345 S 1005 242 1330 360' fill='none' stroke='%23050505' stroke-width='2' stroke-opacity='.12'/%3E%3Cpath d='M-90 216 C 165 105 355 290 615 178 S 1000 88 1330 190' fill='none' stroke='%23f51f29' stroke-width='2' stroke-opacity='.12'/%3E%3C/svg%3E");
  background-position: 50% 48%;
  background-repeat: repeat-x;
  background-size: 1180px 495px;
  content: "";
  animation: wave-drift 96s linear infinite;
}

.login-bg::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(246,246,244,0.82)),
    radial-gradient(circle at 78% 18%, rgba(245,31,41,0.08), transparent 34%);
  content: "";
}

.stream-line {
  position: absolute;
  left: -35vw;
  width: 34vw;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(245,31,41,0.22), rgba(5,5,5,0.1), transparent);
  opacity: 0.18;
  transform: rotate(-8deg);
}

.line-one { top: 25%; animation: stream-pass 28s linear infinite; }
.line-two { top: 52%; animation: stream-pass 36s linear -14s infinite; }
.line-three { top: 78%; animation: stream-pass 44s linear -25s infinite; }

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 940px);
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(230px, 0.82fr) minmax(280px, 1fr);
  grid-template-areas:
    "identity copy"
    "identity action";
  gap: 30px 36px;
  align-items: center;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  animation: login-card-in 1900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-brand {
  grid-area: identity;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  animation: login-content-in 1700ms cubic-bezier(0.16, 1, 0.3, 1) 220ms both;
}

.login-identity-mark {
  display: block;
  width: min(340px, 100%);
  height: min(340px, 70vw);
  object-fit: cover;
  object-position: 50% 24%;
  border-radius: 0;
}

.login-brain-lockup {
  margin: 0;
  color: #121316;
  font-size: clamp(50px, 8.2vw, 88px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.login-copy {
  grid-area: copy;
  animation: login-content-in 1800ms cubic-bezier(0.16, 1, 0.3, 1) 520ms both;
}

.eyebrow {
  display: inline-flex;
  border: 1px solid rgba(245,31,41,0.24);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(245,31,41,0.08);
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-copy h2 {
  max-width: 390px;
  margin: 16px 0 0;
  color: var(--text);
  font-size: 44px;
  font-weight: 850;
  line-height: 0.98;
}

.login-copy p {
  max-width: 390px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.login-action {
  grid-area: action;
  display: grid;
  gap: 10px;
  width: 100%;
  animation: login-content-in 1700ms cubic-bezier(0.16, 1, 0.3, 1) 880ms both;
}

.login-panel.logo-only {
  display: block;
  width: fit-content;
  margin: 0 0 8px;
}

.login-panel.logo-only .login-copy,
.login-panel.logo-only .login-action {
  display: none;
}

.okta-login {
  position: relative;
  display: inline-flex;
  min-height: 52px;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(245,31,41,0.62);
  border-radius: 6px;
  background: var(--brand-red);
  box-shadow: 0 18px 42px rgba(245,31,41,0.22);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.okta-login::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 32%, rgba(255,255,255,0.52) 45%, transparent 58%);
  content: "";
  opacity: 0.16;
  transform: translateX(-130%);
  animation: button-sheen 14s ease-in-out infinite;
}

.okta-login span,
.okta-login b {
  position: relative;
  z-index: 1;
}

.okta-login b {
  display: grid;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

.status-text {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.status-text.error {
  color: #a5181f;
}

.status-text.ok {
  color: #136a34;
}

.app-panel {
  max-width: 860px;
  margin: 0 auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.app-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.mono {
  margin: 4px 0 0;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--muted);
  font-size: 11px;
}

.app-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
}

.api-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.endpoint {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.endpoint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.endpoint-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.method {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
}

.path {
  margin-top: 5px;
  color: #343432;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}

.endpoint-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.endpoint button {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.output {
  margin-top: 10px;
  min-height: 120px;
  border: 1px solid #252525;
  border-radius: 10px;
  padding: 10px;
  background: #121212;
  color: #f1f1f1;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  overflow: auto;
}

@media (max-width: 720px) {
  body.login-body {
    padding: 20px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "identity"
      "copy"
      "action";
    gap: 20px;
    text-align: left;
  }

  .login-copy h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .login-identity-mark {
    width: min(280px, 100%);
    height: min(280px, 74vw);
    object-position: 50% 22%;
  }

  .login-brain-lockup {
    font-size: clamp(40px, 14vw, 72px);
  }

  .okta-login {
    min-height: 50px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes wave-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-590px); }
}

@keyframes stream-pass {
  0% { transform: translateX(-8vw) rotate(-8deg); opacity: 0; }
  8% { opacity: 0.18; }
  92% { opacity: 0.18; }
  100% { transform: translateX(142vw) rotate(-8deg); opacity: 0; }
}

@keyframes login-card-in {
  0% { transform: translateY(26px) scale(0.985); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes login-content-in {
  0% { transform: translateY(24px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes button-sheen {
  0% { transform: translateX(-130%); }
  14% { transform: translateX(170%); }
  100% { transform: translateX(170%); }
}
