* {
  box-sizing: border-box;
}

:root {
  --ink: #15171a;
  --muted: #737982;
  --line: #e4e6e9;
  --surface: #ffffff;
  --page: #f4f5f7;
  --accent: #15171a;
  --focus: #7c3aed;
}

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

body {
  min-height: 100vh;
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(124, 58, 237, .08), transparent 30%),
    radial-gradient(circle at 90% 85%, rgba(59, 130, 246, .07), transparent 28%),
    var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  width: min(100%, 620px);
  padding: 42px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 28px;
  box-shadow:
    0 30px 80px rgba(20, 24, 31, .10),
    0 4px 18px rgba(20, 24, 31, .04);
  backdrop-filter: blur(16px);
  animation: card-in .55s ease-out both;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(21, 23, 26, .16);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.intro p {
  max-width: 480px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-form {
  margin-top: 34px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px 16px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fafbfc;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}

.field input::placeholder {
  color: #a4a9b0;
}

.field input:hover {
  background: #fff;
  border-color: #d5d8dc;
}

.field input:focus {
  background: #fff;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .10);
}

.field input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 23px 0 18px;
  color: #626871;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.consent input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.submit-button {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.submit-button svg {
  width: 19px;
  height: 19px;
  transition: transform .2s ease;
}

.submit-button:hover {
  background: #292c31;
  box-shadow: 0 12px 26px rgba(21, 23, 26, .16);
  transform: translateY(-1px);
}

.submit-button:hover svg {
  transform: translateX(3px);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(124, 58, 237, .25);
  outline-offset: 3px;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 17px 0 0;
  color: #969ba2;
  font-size: 11px;
}

.secure-note svg {
  width: 15px;
  height: 15px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .page-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 28px 22px;
    border-radius: 22px;
  }

  .brand-mark {
    margin-bottom: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .field-full {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ── Premium motion layer ───────────────────────────────────────────── */

body {
  overflow-x: hidden;
  position: relative;
}

.page-shell {
  isolation: isolate;
  overflow: hidden;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 42vw;
  height: 42vw;
  min-width: 280px;
  min-height: 280px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .28;
  pointer-events: none;
  will-change: transform;
}

.ambient-one {
  top: -16vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(124, 58, 237, .42), transparent 68%);
  animation: ambient-drift-one 14s ease-in-out infinite alternate;
}

.ambient-two {
  right: -13vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(59, 130, 246, .30), transparent 68%);
  animation: ambient-drift-two 17s ease-in-out infinite alternate;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.auth-card {
  position: relative;
  overflow: hidden;
  animation: card-in .7s cubic-bezier(.22, 1, .36, 1) both;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -180px;
  left: -120px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, .08), transparent 68%);
  pointer-events: none;
  animation: card-glow 9s ease-in-out infinite alternate;
}

.brand-mark {
  position: relative;
  overflow: hidden;
  animation: mark-pop .7s .12s cubic-bezier(.22, 1, .36, 1) both;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -60%;
  background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.45) 50%, transparent 62%);
  transform: translateX(-65%) rotate(8deg);
  animation: logo-shine 4.5s 1.2s ease-in-out infinite;
}

.intro {
  animation: content-in .65s .16s cubic-bezier(.22, 1, .36, 1) both;
}

.auth-form {
  animation: content-in .65s .24s cubic-bezier(.22, 1, .36, 1) both;
}

.progress-line {
  height: 2px;
  margin: 0 0 23px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f2;
}

.progress-line span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  transition: width .4s cubic-bezier(.22, 1, .36, 1);
}

.field {
  position: relative;
}

.field label {
  transition: color .2s ease, transform .2s ease;
}

.field.is-focused label {
  color: #7c3aed;
  transform: translateX(2px);
}

.field input {
  transform: translateY(0);
}

.field input:focus {
  transform: translateY(-1px);
}

.submit-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.submit-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 45%;
  height: 100%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transition: none;
}

.submit-button:hover::before {
  animation: button-shine .75s ease-out;
}

.button-label,
.button-check {
  transition: opacity .25s ease, transform .25s ease;
}

.button-check {
  position: absolute;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.65);
}

.button-check svg {
  width: 20px;
  height: 20px;
}

.submit-button.is-loading .button-label {
  opacity: .55;
}

.submit-button.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

.submit-button.is-success {
  background: #16794d;
  box-shadow: 0 12px 26px rgba(22, 121, 77, .16);
}

.submit-button.is-success .button-label {
  opacity: 0;
  transform: translateY(7px);
}

.submit-button.is-success .button-check {
  opacity: 1;
  transform: scale(1);
}

.success-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  color: #16794d;
  font-size: 12px;
  line-height: 1.4;
  transform: translateY(-5px);
  transition: max-height .45s ease, margin-top .45s ease, opacity .35s ease, transform .45s ease;
}

.success-message.is-visible {
  max-height: 50px;
  margin-top: 15px;
  opacity: 1;
  transform: translateY(0);
}

.success-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(22, 121, 77, .10);
  animation: success-pop .5s cubic-bezier(.22, 1, .36, 1);
}

.success-icon svg {
  width: 13px;
  height: 13px;
}

@keyframes ambient-drift-one {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(7vw, 5vh, 0) scale(1.12); }
}

@keyframes ambient-drift-two {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-6vw, -5vh, 0) scale(1.14); }
}

@keyframes card-glow {
  0% { transform: translate(0, 0) scale(.9); opacity: .7; }
  100% { transform: translate(80px, 70px) scale(1.15); opacity: 1; }
}

@keyframes mark-pop {
  from { opacity: 0; transform: translateY(10px) scale(.82) rotate(-5deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes logo-shine {
  0%, 65% { transform: translateX(-65%) rotate(8deg); }
  85%, 100% { transform: translateX(290%) rotate(8deg); }
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes button-shine {
  from { left: -75%; }
  to { left: 145%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes success-pop {
  0% { transform: scale(0); }
  65% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ambient,
  .brand-mark,
  .brand-mark::after,
  .intro,
  .auth-form,
  .auth-card::before {
    animation: none !important;
  }
}


/* ── Desktop split layout: image + authorization form ─────────────── */

.page-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 620px);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  width: min(1380px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
}

.page-shell > .ambient,
.page-shell > .noise {
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.page-shell > .ambient {
  width: 42vw;
  height: 42vw;
}

.page-shell > .noise {
  inset: 0;
  width: auto;
  height: auto;
}

.investment-visual {
  position: relative;
  display: block;
  width: 100%;
  height: min(720px, calc(100vh - 84px));
  min-height: 560px;
  overflow: hidden;
  border-radius: 30px;
  background: #111713;
  box-shadow: 0 30px 80px rgba(10, 17, 13, .16);
  isolation: isolate;
  animation: visual-in .8s cubic-bezier(.22, 1, .36, 1) both;
}

.visual-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  animation: visual-breathe 16s ease-in-out infinite alternate;
}

.visual-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 13, 10, .02) 35%, rgba(7, 13, 10, .72) 100%),
    linear-gradient(90deg, rgba(7, 13, 10, .18), transparent 62%);
  pointer-events: none;
}

.visual-content {
  position: absolute;
  z-index: 2;
  left: clamp(26px, 4vw, 52px);
  right: 26px;
  bottom: clamp(28px, 4vw, 52px);
  color: #f4f6f2;
  animation: visual-copy-in .8s .2s cubic-bezier(.22, 1, .36, 1) both;
}

.visual-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: rgba(238, 244, 237, .68);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}

.visual-content h2 {
  margin: 0;
  max-width: 440px;
  font-size: clamp(38px, 4vw, 62px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 600;
}

.visual-content h2 em {
  color: #c7d5ca;
  font-style: normal;
  font-weight: 400;
}

.visual-line {
  width: 54px;
  height: 1px;
  margin: 22px 0 15px;
  background: rgba(225, 236, 226, .55);
}

.visual-content p {
  margin: 0;
  color: rgba(238, 244, 237, .67);
  font-size: 13px;
}

.page-shell > .auth-card {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  justify-self: stretch;
}

.page-shell > .investment-visual {
  grid-column: 1;
  grid-row: 1;
}

@keyframes visual-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes visual-breathe {
  from { transform: scale(1.02); }
  to { transform: scale(1.06); }
}

@keyframes visual-copy-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .page-shell {
    display: block;
    width: min(100% - 32px, 680px);
    min-height: 100vh;
    padding: 16px 0;
  }

  .investment-visual {
    display: none;
  }

  .page-shell > .auth-card {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .investment-visual,
  .visual-image,
  .visual-content {
    animation: none !important;
  }
}


/* Final image reliability fix */
.investment-visual .visual-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  background: transparent;
  opacity: 1;
  visibility: visible;
  transform: scale(1.02);
  animation: visual-breathe 16s ease-in-out infinite alternate;
}


/* ── iPad responsive composition ───────────────────────────────────── */

/* iPad / tablet portrait: keep the investment image visible above the form. */
@media (min-width: 601px) and (max-width: 980px) {
  .page-shell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    width: min(100% - 40px, 720px);
    min-height: 100vh;
    padding: 28px 0;
    gap: 22px;
  }

  .investment-visual {
    display: block;
    width: 100%;
    height: clamp(300px, 42vh, 430px);
    min-height: 0;
    flex: 0 0 auto;
    border-radius: 26px;
  }

  .page-shell > .investment-visual,
  .page-shell > .auth-card {
    grid-column: auto;
    grid-row: auto;
  }

  .page-shell > .auth-card {
    width: 100%;
    max-width: 680px;
    align-self: center;
  }

  .visual-content h2 {
    font-size: clamp(34px, 6vw, 50px);
  }
}

/* Small phones: focus entirely on the authorization form. */
@media (max-width: 600px) {
  .investment-visual {
    display: none;
  }
}


/* ── Mobile investment image ───────────────────────────────────────── */

@media (max-width: 600px) {
  .page-shell {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
    padding: 12px;
    gap: 14px;
  }

  .investment-visual {
    display: block;
    width: 100%;
    height: 42vh;
    min-height: 240px;
    max-height: 360px;
    flex: 0 0 auto;
    border-radius: 20px;
  }

  .page-shell > .investment-visual,
  .page-shell > .auth-card {
    grid-column: auto;
    grid-row: auto;
  }

  .visual-content {
    left: 22px;
    right: 22px;
    bottom: 22px;
  }

  .visual-content h2 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .visual-content p {
    font-size: 11px;
  }

  .auth-card {
    width: 100%;
    padding: 26px 20px;
    border-radius: 20px;
  }

  .brand-mark {
    margin-bottom: 20px;
  }

  .auth-form {
    margin-top: 27px;
  }
}
