/* Final polish layer: loaded last, keeps existing flows intact. */
:root {
  --polish-ink: #f8fbff;
  --polish-muted: rgba(226, 235, 255, 0.72);
  --polish-line: rgba(176, 206, 255, 0.2);
  --polish-panel: rgba(12, 18, 64, 0.78);
  --polish-card: rgba(255, 255, 255, 0.065);
  --polish-accent: #74f2df;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.page-auth input,
.page-auth select,
.page-auth textarea,
.page-client input,
.page-client select,
.page-client textarea,
.page-admin input,
.page-admin select,
.page-admin textarea {
  font-size: 16px;
}

.page-auth-neo .center-page,
.page-auth-register-neo .center-page {
  min-height: calc(var(--app-vh, 1vh) * 100);
  padding: clamp(1rem, 3vw, 2rem);
}

.page-auth-neo .auth-shell-wrap {
  width: min(94vw, 980px);
}

.auth-neo-shell {
  min-height: 680px;
  padding: clamp(1.4rem, 3vw, 2.35rem);
  border-radius: 34px;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background:
    radial-gradient(circle at 16% 18%, rgba(91, 174, 255, 0.22), transparent 28%),
    radial-gradient(circle at 20% 88%, rgba(145, 76, 255, 0.22), transparent 26%),
    linear-gradient(150deg, rgba(10, 15, 68, 0.94), rgba(18, 27, 95, 0.86) 48%, rgba(7, 10, 46, 0.96));
}

.auth-neo-brand {
  position: absolute;
  top: clamp(1.6rem, 3vw, 2.3rem);
  left: clamp(1.8rem, 3.5vw, 3rem);
  margin: 0;
  justify-content: flex-start;
  font-size: clamp(3.25rem, 6vw, 4.45rem);
  line-height: 0.86;
}

.auth-neo-visual {
  top: 9.1rem;
  left: clamp(1.5rem, 4vw, 3.1rem);
  right: auto;
  width: min(42vw, 25.5rem);
  height: min(25vw, 15.4rem);
}

.auth-neo-bank-card {
  transform: rotate(-8deg);
}

.auth-neo-panel {
  width: min(100%, 430px);
  margin: 0;
  padding: clamp(1.1rem, 2.5vw, 1.45rem);
  align-self: center;
  border: 1px solid var(--polish-line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(8, 12, 50, 0.62);
  box-shadow:
    0 28px 72px rgba(4, 8, 35, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(18px);
}

.page-auth-neo .auth-neo-shell {
  width: min(100%, 980px);
}

.page-auth-register-neo .register-neo-shell {
  width: min(100%, 900px);
}

.auth-neo-copy {
  max-width: 100%;
  gap: 0.55rem;
}

.auth-neo-copy h1 {
  font-size: clamp(2.45rem, 5.6vw, 3.15rem);
  line-height: 0.96;
}

.auth-neo-subtitle {
  max-width: 21rem;
  font-size: clamp(0.95rem, 1.7vw, 1.06rem);
  line-height: 1.45;
}

.auth-neo-form {
  margin-top: 1.15rem;
  gap: 0.72rem;
}

.auth-neo-field {
  min-height: 3.9rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(170, 195, 255, 0.13), rgba(95, 118, 218, 0.09)),
    rgba(255, 255, 255, 0.035);
}

.auth-neo-field input {
  font-size: 1rem;
  font-weight: 650;
}

.auth-neo-submit,
.register-neo-submit {
  min-height: 4rem;
  border-radius: 999px;
  color: #07122f;
  background: linear-gradient(100deg, #55c7ff 0%, #7990ff 48%, #9bf684 100%);
  box-shadow: 0 18px 42px rgba(69, 178, 255, 0.22);
}

.auth-neo-submit:hover,
.register-neo-submit:hover {
  transform: translateY(-1px);
  filter: saturate(1.06);
}

.auth-neo-admin-card {
  padding: 1rem;
  border-radius: 20px;
}

.auth-neo-admin-card p {
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-neo-register {
  margin-top: 1.15rem;
  padding-top: 1.2rem;
}

.auth-neo-register a,
.auth-neo-register-link {
  font-size: clamp(1.8rem, 4vw, 2.35rem);
  line-height: 1;
}

.register-neo-wrap {
  width: min(94vw, 900px);
}

.register-neo-shell {
  min-height: auto;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: 34px;
}

.register-neo-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--polish-line);
  background:
    radial-gradient(circle at 92% 12%, rgba(94, 195, 255, 0.19), transparent 30%),
    linear-gradient(150deg, rgba(24, 31, 99, 0.76), rgba(9, 13, 54, 0.86));
}

.register-neo-head {
  gap: 0.5rem;
}

.register-neo-head h1 {
  max-width: 620px;
  font-size: clamp(2.2rem, 6vw, 3.55rem);
  line-height: 0.98;
}

.register-neo-head p {
  max-width: 540px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.5;
}

.register-neo-step {
  margin-top: 1.4rem;
  padding: clamp(1rem, 2.2vw, 1.35rem);
  border-radius: 24px;
}

.register-neo-step-head h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.register-neo-form {
  gap: 0.68rem;
}

.register-neo-form label {
  font-size: 0.82rem;
}

.register-neo-form input {
  min-height: 3.65rem;
  padding: 0 1.1rem;
  border-radius: 18px;
  font-size: 1rem;
}

.register-neo-foot {
  margin-top: 1.05rem;
  padding: 0.85rem 1rem;
}

.page-client .app-shell-client,
.page-admin .app-shell {
  max-width: 1240px;
}

.page-client .topbar,
.page-admin .topbar {
  border-radius: 1.55rem;
}

.page-client .card,
.page-admin .card {
  border-color: rgba(176, 206, 255, 0.16);
}

.page-client .client-bottom-nav {
  max-width: min(880px, calc(100vw - 1.5rem));
}

@media (max-width: 760px) {
  .page-auth-neo .center-page,
  .page-auth-register-neo .center-page {
    padding: 0.72rem;
    align-items: flex-start;
  }

  .page-auth-neo .auth-shell-wrap,
  .register-neo-wrap {
    width: 100%;
  }

  .auth-neo-shell {
    min-height: auto;
    display: block;
    padding: 1rem;
    border-radius: 28px;
  }

  .auth-neo-brand {
    position: relative;
    top: auto;
    left: auto;
    justify-content: center;
    font-size: clamp(2.7rem, 13vw, 3.55rem);
  }

  .auth-neo-visual {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 20rem);
    height: 11.5rem;
    margin: 0.2rem auto 0;
  }

  .auth-neo-bank-card {
    transform: rotate(-4deg) scale(0.92);
    transform-origin: center;
  }

  .auth-neo-card-number {
    font-size: 1.02rem;
    letter-spacing: 0.13em;
  }

  .auth-neo-panel {
    width: 100%;
    margin-top: -1.1rem;
    padding: 1rem;
    border-radius: 24px;
  }

  .auth-neo-copy h1 {
    font-size: clamp(2rem, 10vw, 2.45rem);
    letter-spacing: -0.055em;
  }

  .auth-neo-subtitle {
    font-size: 0.97rem;
  }

  .auth-neo-field {
    min-height: 3.65rem;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
  }

  .auth-neo-submit,
  .register-neo-submit {
    min-height: 3.75rem;
    font-size: 1.05rem;
  }

  .auth-neo-admin-card {
    padding: 0.9rem;
  }

  .auth-neo-admin-card p {
    font-size: 0.84rem;
  }

  .auth-neo-register a,
  .auth-neo-register-link {
    font-size: 2rem;
  }

  .register-neo-shell {
    padding: 0.95rem;
    border-radius: 28px;
  }

  .register-neo-panel {
    padding: 1rem;
    border-radius: 24px;
  }

  .register-neo-head h1 {
    font-size: clamp(2.05rem, 11vw, 2.75rem);
  }

  .register-neo-head p {
    font-size: 0.98rem;
  }

  .register-neo-step {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 20px;
  }

  .register-neo-form input {
    min-height: 3.45rem;
  }

  .register-neo-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .auth-neo-shell,
  .register-neo-shell {
    border-radius: 24px;
  }

  .auth-neo-visual {
    height: 10.2rem;
  }

  .auth-neo-copy h1 {
    font-size: 2.05rem;
  }

  .auth-neo-register a,
  .auth-neo-register-link {
    font-size: 1.72rem;
  }

  .register-neo-head h1 {
    font-size: 2.18rem;
  }
}

/* Device-aware layout driven by responsive.js. */
html.device-desktop .page-client .dashboard,
html.device-desktop .page-admin .dashboard {
  width: 100%;
}

html.device-tablet .page-auth-neo .auth-shell-wrap {
  width: min(96vw, 860px);
}

html.device-tablet .auth-neo-shell {
  min-height: auto;
  padding: 1.35rem;
}

html.device-tablet.orientation-portrait .auth-neo-shell {
  display: block;
  width: min(100%, 620px);
}

html.device-tablet.orientation-portrait .auth-neo-brand {
  position: relative;
  top: auto;
  left: auto;
  justify-content: center;
  margin-bottom: 0.3rem;
}

html.device-tablet.orientation-portrait .auth-neo-visual {
  position: relative;
  top: auto;
  left: auto;
  width: min(100%, 25rem);
  height: 14rem;
  margin: 0 auto;
}

html.device-tablet.orientation-portrait .auth-neo-panel {
  width: min(100%, 500px);
  margin: -0.85rem auto 0;
}

html.device-tablet .register-neo-wrap {
  width: min(96vw, 820px);
}

html.device-tablet .page-client .grid-two,
html.device-tablet .page-admin .grid-two,
html.device-mobile .page-client .grid-two,
html.device-mobile .page-admin .grid-two {
  grid-template-columns: 1fr;
}

html.device-tablet .page-admin .admin-premium-grid,
html.device-mobile .page-admin .admin-premium-grid {
  grid-template-columns: 1fr;
}

html.device-tablet .page-admin .admin-hero-card,
html.device-mobile .page-admin .admin-hero-card {
  grid-template-columns: 1fr;
}

html.device-tablet .page-admin .admin-action-grid,
html.device-mobile .page-admin .admin-action-grid,
html.device-tablet .page-client .premium-action-grid,
html.device-mobile .page-client .premium-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html.device-mobile .page-admin .admin-action-grid,
html.device-mobile .page-client .premium-action-grid {
  gap: 0.7rem;
}

html.device-mobile .page-admin .quick-action-card,
html.device-mobile .page-client .quick-action-card {
  min-height: 7rem;
  padding: 0.85rem 0.7rem;
}

html.device-mobile .page-client .app-shell-client,
html.device-mobile .page-admin .app-shell {
  width: 100%;
  padding-inline: 0.75rem;
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

html.device-tablet .page-client .app-shell-client,
html.device-tablet .page-admin .app-shell {
  width: 100%;
  padding-inline: clamp(0.9rem, 2vw, 1.3rem);
}

html.device-mobile .page-client .topbar,
html.device-mobile .page-admin .topbar {
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem;
}

html.device-mobile .page-client .topbar-actions,
html.device-mobile .page-admin .topbar-actions {
  width: 100%;
  justify-content: space-between;
  gap: 0.55rem;
}

html.device-mobile .page-client .title,
html.device-mobile .page-admin .title {
  font-size: clamp(1.65rem, 8vw, 2.2rem);
  line-height: 1;
}

html.device-tablet .client-offers-grid,
html.device-mobile .client-offers-grid {
  grid-template-columns: 1fr;
}

html.device-mobile .client-offer-card {
  min-height: auto;
}

html.device-mobile .client-bottom-nav {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(100vw - 1rem, 520px);
  bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
  padding: 0.45rem;
  border-radius: 1.25rem;
}

html.device-mobile .client-bottom-nav button {
  min-width: 0;
  padding: 0.55rem 0.35rem;
}

html.device-mobile .client-bottom-nav button strong {
  font-size: 0.67rem;
}

html.device-mobile.orientation-landscape .page-auth-neo .center-page,
html.device-mobile.orientation-landscape .page-auth-register-neo .center-page {
  padding: 0.55rem;
}

html.device-mobile.orientation-landscape .auth-neo-shell {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 0.8rem;
  align-items: center;
}

html.device-mobile.orientation-landscape .auth-neo-brand {
  grid-column: 1;
  font-size: clamp(2rem, 8vw, 2.9rem);
}

html.device-mobile.orientation-landscape .auth-neo-visual {
  grid-column: 1;
  height: 9rem;
}

html.device-mobile.orientation-landscape .auth-neo-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
}

html.device-mobile.orientation-landscape .auth-neo-admin-card,
html.device-mobile.orientation-landscape .auth-neo-subtitle {
  display: none;
}

html.input-touch input,
html.input-touch select,
html.input-touch textarea,
html.input-touch button {
  touch-action: manipulation;
}
