@font-face {
  font-family: "KariSystem";
  src: local("Inter"), local("Segoe UI"), local("Arial");
  font-display: swap;
}

:root {
  --page-bg: #f8f1f4;
  --card-bg: rgba(255,255,255,.95);
  --text: #202b36;
  --muted: #7f8b9a;
  --field-border: #d7dce4;
  --field-bg: rgba(255,255,255,.76);
  --accent: #e42e7d;
  --accent-dark: #cd216d;
  --card-shadow:
    0 34px 72px rgba(98, 74, 86, .18),
    0 14px 28px rgba(98, 74, 86, .12),
    0 4px 10px rgba(98, 74, 86, .08);
  --button-shadow:
    0 18px 26px rgba(224, 39, 116, .18),
    0 6px 10px rgba(224, 39, 116, .10);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "KariSystem", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.88) 0 15%, rgba(255,255,255,.42) 38%, transparent 57%),
    linear-gradient(135deg, #fcf7f8 0%, #f7eff2 100%);
}

button, input {
  font: inherit;
}

.login-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  isolation: isolate;
}

.ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(250,245,247,.08), rgba(248,241,244,.12)),
    url("ambient-marketplace-full.png") center center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 5;
  width: min(520px, calc(100vw - 48px));
  padding: 52px 48px 42px;
  border-radius: 28px;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 14px -10px -16px 14px;
  border-radius: 26px;
  background: rgba(109, 79, 93, .05);
  filter: blur(12px);
  pointer-events: none;
}

.auth-header {
  margin-bottom: 34px;
}

.auth-header h1 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 31px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.auth-header h1 strong {
  font-weight: 800;
}

.auth-header h1 span {
  color: var(--accent);
  font-weight: 700;
}

.auth-header p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
  font-weight: 500;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-wrap {
  position: relative;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.control-wrap:focus-within {
  border-color: rgba(228, 46, 125, .42);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(228, 46, 125, .08);
}

.control-icon {
  width: 19px;
  height: 19px;
  margin: 0 12px 0 16px;
  color: #8d97a3;
  flex: 0 0 auto;
}

.control-icon svg,
.password-toggle svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-wrap input[type="email"],
.control-wrap input[type="password"],
.control-wrap input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #455262;
  font-size: 15px;
  font-weight: 500;
}

.control-wrap input::placeholder {
  color: #95a0ad;
  opacity: 1;
}

.password-toggle {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  margin-right: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8b95a1;
  cursor: pointer;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.form-meta {
  min-height: 28px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.remember {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #657084;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid #d3d8e0;
  border-radius: 5px;
  background: rgba(255,255,255,.86);
  transition: .18s ease;
}

.checkmark svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.75);
  transition: .18s ease;
}

.remember input:checked + .checkmark {
  border-color: var(--accent);
  background: var(--accent);
}

.remember input:checked + .checkmark svg {
  opacity: 1;
  transform: scale(1);
}

.forgot-link {
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.forgot-link:hover {
  color: var(--accent-dark);
}

.submit-button {
  width: 100%;
  height: 54px;
  margin-top: 2px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #eb3887 0%, #d91f70 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  transition: transform .15s ease, filter .18s ease, box-shadow .18s ease;
}

.submit-button:hover {
  filter: brightness(.99);
  box-shadow:
    0 20px 30px rgba(224, 39, 116, .22),
    0 8px 14px rgba(224, 39, 116, .12);
}

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

.form-message {
  min-height: 16px;
  margin: 0;
  color: #78818d;
  font-size: 13px;
  line-height: 1.3;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .login-page {
    padding: 20px 16px;
    min-height: 100dvh;
  }

  .ambient {
    background-position: center center;
    background-size: cover;
  }

  .auth-card {
    width: min(100%, 460px);
    padding: 34px 22px 28px;
    border-radius: 24px;
  }

  .auth-card::after {
    inset: 12px -8px -12px 12px;
    filter: blur(10px);
  }

  .auth-header {
    margin-bottom: 26px;
  }

  .auth-header h1 {
    font-size: 28px;
    gap: 6px;
  }

  .auth-header p {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.5;
  }

  .desktop-break {
    display: none;
  }

  .form-meta {
    margin-top: 2px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .forgot-link {
    padding-left: 29px;
  }
}

@media (max-width: 560px) {
  .login-page {
    padding: 14px;
  }

  .auth-card {
    width: min(100%, 420px);
    padding: 28px 16px 22px;
    border-radius: 22px;
  }

  .auth-header {
    margin-bottom: 22px;
  }

  .auth-header h1 {
    font-size: 25px;
  }

  .auth-header p {
    font-size: 13px;
    margin-top: 12px;
  }

  .control-wrap {
    height: 48px;
  }

  .submit-button {
    height: 52px;
    font-size: 15px;
  }

  .remember,
  .forgot-link {
    font-size: 13px;
  }
}
