:root {
  --bg: #f7f3ed;
  --bg-card: rgba(255, 253, 250, 0.93);
  --text: #382821;
  --text-soft: #8f8178;
  --line: #ddd2c7;
  --line-strong: #cfbfb0;
  --pink: #d84f75;
  --pink-hover: #c94569;
  --pink-soft: #f3d9e1;
  --brown: #3e2b24;
  --error: #b63f4f;
  --shadow: 0 28px 70px rgba(77, 57, 43, 0.10);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

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

.login-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.95) 0 22%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, #fbf8f3 0%, #f5efe7 100%);
}

.bg-orb {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: rgba(224, 198, 174, 0.11);
  filter: blur(1px);
}

.bg-orb-left {
  left: -260px;
  bottom: -170px;
}

.bg-orb-right {
  right: -290px;
  bottom: -140px;
}

.bg-track {
  position: absolute;
  width: 330px;
  height: 160px;
  border-top: 1px dashed rgba(181, 153, 128, 0.28);
  border-radius: 50%;
}

.bg-track-left {
  left: -30px;
  bottom: 60px;
  transform: rotate(14deg);
}

.bg-track-right {
  right: -8px;
  bottom: 125px;
  transform: rotate(-18deg);
}

.login-card {
  width: min(100%, 640px);
  border: 1px solid rgba(199, 183, 167, 0.72);
  border-radius: 26px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.brand-wrap {
  display: flex;
  justify-content: center;
  padding: 42px 50px 20px;
}

.brand-logo {
  display: block;
  width: min(100%, 390px);
  height: auto;
}

.login-header {
  padding: 12px 56px 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 9px;
  color: #b68a6d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.login-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.login-header p:last-child {
  margin: 11px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.login-form {
  margin: 0 56px;
  padding: 30px 0 34px;
  border-top: 1px solid rgba(218, 205, 193, 0.72);
}

.field-group + .field-group {
  margin-top: 20px;
}

.field-group label {
  display: inline-block;
  margin: 0 0 8px;
  color: #4d3a31;
  font-size: 14px;
  font-weight: 750;
}

.label-note {
  color: #aa9c93;
  font-weight: 500;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #9d9087;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  height: 56px;
  padding: 0 52px 0 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.input-shell input::placeholder {
  color: #b0a59d;
}

.input-shell input:focus {
  border-color: rgba(216, 79, 117, 0.68);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(216, 79, 117, 0.09);
}

.input-shell input[aria-invalid="true"] {
  border-color: rgba(182, 63, 79, 0.72);
}

.password-toggle {
  position: absolute;
  right: 11px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  color: #9b8d84;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(90, 67, 53, 0.05);
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.field-error {
  min-height: 18px;
  margin: 5px 0 0;
  color: var(--error);
  font-size: 12px;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: #5c4a40;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.remember-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--pink);
}

.form-message {
  min-height: 20px;
  margin: 14px 0 6px;
  text-align: center;
  color: var(--error);
  font-size: 13px;
}

.form-message.success {
  color: #4e7d5b;
}

.primary-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 58px;
  margin-top: 5px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #df5b7f, #cf476d);
  box-shadow: 0 10px 24px rgba(208, 70, 106, 0.18);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 13px 30px rgba(208, 70, 106, 0.24);
  filter: saturate(1.04);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.74;
}

.button-spinner {
  position: absolute;
  width: 21px;
  height: 21px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}

.primary-button.loading .button-label {
  opacity: 0;
}

.primary-button.loading .button-spinner {
  opacity: 1;
  animation: spin 700ms linear infinite;
}

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

.account-links {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  margin-top: 19px;
}

.account-links a {
  color: #8e796b;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.account-links a:hover {
  color: var(--pink);
}

.link-divider {
  width: 1px;
  height: 18px;
  background: #ddd1c7;
}

.signup-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 25px 24px 28px;
  border-top: 1px solid rgba(218, 205, 193, 0.72);
  color: #8e8178;
  font-size: 13px;
}

.signup-row a {
  color: var(--pink);
  font-weight: 800;
  text-decoration: none;
}

.signup-row a:hover {
  text-decoration: underline;
}

@media (max-width: 680px) {
  .login-page {
    place-items: start center;
    padding: 20px 14px;
  }

  .login-card {
    margin-top: max(14px, env(safe-area-inset-top));
    border-radius: 20px;
  }

  .brand-wrap {
    padding: 32px 28px 16px;
  }

  .brand-logo {
    width: min(100%, 330px);
  }

  .login-header {
    padding: 8px 26px 24px;
  }

  .login-form {
    margin: 0 24px;
    padding-top: 26px;
  }

  .signup-row {
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
