/* =========================================================================
   Hypwave — Sign In / Sign Up portal (dark, starry design)
   Used by pages/sign-in.html and pages/sign-up.html together with style.css
   ========================================================================= */

.portal-body {
  --p-bg: #0D1B2A;
  --p-blue: #FF6A1A;
  --p-blue-2: #E85A10;
  --p-text: #F1F5F9;
  --p-muted: #94A3B8;
  --p-line: rgba(255, 255, 255, .14);
  --p-input: rgba(13, 27, 42, .6);
  min-height: 100vh;
  font-family: 'DM Sans', var(--font-body, system-ui), sans-serif;
  color: var(--p-text);
  background:
    radial-gradient(80% 50% at 15% 10%, rgba(255, 106, 26, .22) 0%, transparent 55%),
    radial-gradient(60% 40% at 90% 90%, rgba(232, 90, 16, .18) 0%, transparent 50%),
    var(--p-bg);
  overflow-x: hidden;
}
.portal-body h1, .portal-body h2, .portal-body h3 { font-family: 'DM Sans', sans-serif; color: #fff; letter-spacing: -.01em; }

/* =========================================================================
   Moving background (same behaviour as app.hypwave.com/login):
   6 stat chips and 42 glowing dots glide across the screen, bounce off the
   edges and off each other. Positions are set every frame by js/auth.js.
   ========================================================================= */
.portal-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.portal-glow { position: absolute; border-radius: 50%; }
.portal-glow--a { width: 520px; height: 520px; top: -14%; left: -10%; background: radial-gradient(circle, rgba(255, 106, 26, .34) 0%, transparent 68%); }
.portal-glow--b { width: 460px; height: 460px; bottom: -12%; right: -8%; background: radial-gradient(circle, rgba(232, 90, 16, .38) 0%, transparent 70%); }
.portal-dot-star {
  position: absolute; left: 0; top: 0; border-radius: 50%;
  width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  background: rgba(255, 179, 138, .7); will-change: transform;
}
.portal-dot-star.is-big { background: radial-gradient(circle, rgba(255, 214, 190, .95) 0%, rgba(255, 140, 77, .4) 70%, transparent 100%); box-shadow: 0 0 10px rgba(255, 140, 77, .4); }
.portal-chip {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 10px;
  width: 210px; height: 56px; padding: 12px 14px; box-sizing: border-box;
  border-radius: 14px; background: rgba(13, 27, 42, .55); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
  will-change: transform;
}
.portal-chip-icon { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 106, 26, .4); color: #FFD6BE; }
.portal-chip > span:last-child { min-width: 0; flex: 1; }
.portal-chip strong { display: block; font-size: 13.5px; font-weight: 750; line-height: 1.2; letter-spacing: -.2px; color: #F8FAFC; white-space: nowrap; }
.portal-chip small { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; line-height: 1.25; color: rgba(203, 213, 225, .92); white-space: nowrap; }
@media (max-width: 599px) {
  .portal-chip { display: none; }
  .portal-dot-star.is-odd { display: none; }
}

.portal-stage { position: relative; width: min(100%, 1040px); }
.portal-stage--narrow { width: min(100%, 880px); }


.portal {
  position: relative; z-index: 1;
  min-height: 100vh; display: grid; place-items: center;
  padding: 72px 20px 40px;
}
.portal-back {
  position: absolute; top: 20px; left: 24px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--p-muted); font-size: .9rem; font-weight: 500;
}
.portal-back:hover { color: #fff; text-decoration: none; }

/* Card */
.portal-card {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  background: rgba(13, 27, 42, .28); border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
  overflow: hidden;
}

/* Left: blue feature panel with slider */
.portal-side {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; min-height: 520px;
  padding: 26px 24px 26px;
  background: linear-gradient(160deg, rgba(255, 106, 26, .92) 0%, rgba(194, 65, 12, .95) 100%);
}
.portal-side::before { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; left: -110px; bottom: -40px; background: rgba(255, 255, 255, .08); }
.portal-side::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -60px; top: -40px; background: radial-gradient(circle, rgba(255, 140, 77, .35), transparent 70%); }
.portal-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: .98rem; }
.portal-brand:hover { text-decoration: none; }
.portal-brand img { display: block; width: auto; height: 46px; }
.portal-slides { position: relative; z-index: 1; flex: 1; display: grid; align-items: end; margin-top: 30px; }
.portal-slide { grid-area: 1 / 1; opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; visibility: hidden; }
.portal-slide.is-active { opacity: 1; transform: none; visibility: visible; }
.portal-slide-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); color: #fff; }
.portal-pill { display: inline-block; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.portal-slide h2 { font-size: 1.9rem; line-height: 1.2; margin: 12px 0 10px; }
.portal-slide p { color: #FFE5D4; font-size: .95rem; line-height: 1.6; }
.portal-nav { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 30px; }
.portal-dots { display: flex; gap: 6px; }
.portal-dot { width: 8px; height: 6px; padding: 0; border-radius: 99px; background: rgba(255, 255, 255, .4); transition: width .3s, background-color .3s; }
.portal-dot[aria-current="true"] { width: 28px; background: #fff; }
.portal-arrows { display: flex; gap: 8px; }
.portal-arrow { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255, 255, 255, .35); background: rgba(13, 27, 42, .25); transition: background-color .2s; }
.portal-arrow:hover { background: rgba(255, 255, 255, .18); }

/* Right: form */
.portal-main { padding: 34px 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.portal-main h1 { font-size: 1.6rem; margin-bottom: 4px; }
.portal-sub { color: var(--p-muted); font-size: .95rem; margin-bottom: 22px; }
.portal-label { color: #E2E8F0; font-size: .92rem; font-weight: 600; margin-bottom: 10px; }
.portal-form { display: grid; gap: 16px; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-grid .span-2 { grid-column: 1 / -1; }

/* Floating-label inputs */
.pfield { position: relative; gap: 6px; }
.pfield .input {
  height: 52px; padding: 18px 14px 6px; width: 100%;
  background: var(--p-input); color: #fff; font-size: .98rem;
  border: 1px solid var(--p-line); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.pfield .input:focus { outline: none; border-color: var(--p-blue); box-shadow: 0 0 0 3px rgba(255, 106, 26, .3); }
.pfield label {
  position: absolute; left: 14px; top: 15px; pointer-events: none;
  color: var(--p-muted); font-size: .98rem; font-weight: 500;
  transition: top .15s ease, font-size .15s ease, color .15s ease;
}
.pfield .input:focus + label,
.pfield .input:not(:placeholder-shown) + label { top: 6px; font-size: .74rem; color: #CBD5E1; }
.pfield .input::placeholder { color: transparent; }
.pfield.has-toggle .input { padding-right: 48px; }
.pfield .pw-toggle { position: absolute; right: 8px; top: 9px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #CBD5E1; background: none; }
.pfield .pw-toggle:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.pfield.has-error .input { border-color: #F87171; background: rgba(127, 29, 29, .25); }
.pfield.is-valid .input { border-color: rgba(52, 211, 153, .6); }
.pfield .field-error { color: #FCA5A5; font-size: .8rem; }

/* Account-type tabs (sign up) */
.portal-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 18px; background: rgba(13, 27, 42, .6); border: 1px solid var(--p-line); border-radius: 12px; }
.portal-tab { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; text-align: left; color: #E2E8F0; background: none; transition: background-color .2s, box-shadow .2s; }
.portal-tab-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 106, 26, .25); color: #FFD6BE; flex-shrink: 0; }
.portal-tab strong { display: block; font-size: .9rem; color: #fff; }
.portal-tab small { display: block; font-size: .74rem; color: var(--p-muted); }
.portal-tab[aria-selected="true"] { background: var(--p-blue); box-shadow: 0 8px 20px -10px rgba(255, 106, 26, .9); }
.portal-tab[aria-selected="true"] .portal-tab-icon { background: rgba(255, 255, 255, .25); color: #0D1B2A; }
.portal-tab[aria-selected="true"] strong { color: #0D1B2A; }
.portal-tab[aria-selected="true"] small { color: rgba(13, 27, 42, .8); }
.portal-tab:focus-visible { outline: 2px solid #FFB38A; outline-offset: 2px; }

.portal-row { display: flex; justify-content: flex-end; margin-top: -6px; }
.portal-link { color: #FF8A4C; font-weight: 600; }
.portal-link:hover { color: #FFB38A; }
.portal-submit {
  height: 44px; width: 100%; border-radius: 10px; border: 0;
  background: var(--p-blue); color: #0D1B2A; font-weight: 700; font-size: .95rem;
  transition: background-color .2s, box-shadow .2s;
}
.portal-submit:hover { background: var(--p-blue-2); box-shadow: 0 10px 24px -12px rgba(255, 106, 26, .9); }
.portal-submit.is-loading { opacity: .7; cursor: progress; }
.portal-switch { text-align: center; color: var(--p-muted); font-size: .95rem; margin-top: 16px; }
.portal-terms { color: var(--p-muted); font-size: .8rem; text-align: center; }
.portal-terms a { color: #CBD5E1; text-decoration: underline; text-underline-offset: 2px; }
.portal-note { position: relative; z-index: 1; max-width: 640px; margin: 18px auto 0; text-align: center; color: #64748B; font-size: .78rem; }
.portal-note a { color: #94A3B8; text-decoration: underline; }
.portal-body .form-alert { color: var(--color-navy); }

/* Responsive */
@media (max-width: 860px) {
  .portal { padding-top: 64px; }
  .portal-card { grid-template-columns: minmax(0, 1fr); }
  .portal-side { min-height: 0; padding: 22px 20px; }
  .portal-slides { margin-top: 18px; }
  .portal-slide-icon { width: 44px; height: 44px; margin-bottom: 12px; }
  .portal-slide h2 { font-size: 1.35rem; }
  .portal-nav { margin-top: 16px; }
}
@media (max-width: 520px) {
  .portal { padding: 60px 12px 28px; }
  .portal-main { padding: 26px 18px 22px; }
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-tab { padding: 8px; gap: 8px; }
  .portal-tab small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-slide { transition: none; }
}