:root {
  --bg: #f7f3ed;
  --bg-card: rgba(255, 253, 250, 0.95);
  --text: #382821;
  --text-soft: #8f8178;
  --line: #ddd2c7;
  --pink: #d84f75;
  --pink-hover: #c94569;
  --brown: #3e2b24;
  --error: #b63f4f;
  --success: #4e7d5b;
  --shadow: 0 24px 64px rgba(77, 57, 43, 0.10);

  --page-pad-x: clamp(12px, 3vw, 28px);
  --page-pad-y: clamp(12px, 2.4vh, 30px);
  --card-width: min(92vw, 640px);
  --card-radius: clamp(18px, 2vw, 26px);
  --inner-x: clamp(24px, 5vw, 56px);
  --input-height: clamp(46px, 5.6vh, 54px);
  --button-height: clamp(48px, 5.8vh, 56px);
  --field-gap: clamp(7px, 1.15vh, 13px);
}

* {
  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;
}

/* PAGE */
.signup-page {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--page-pad-y) var(--page-pad-x);
  overflow: hidden;
  isolation: isolate;
}

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

.bg-orb {
  position: absolute;
  width: clamp(360px, 44vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(224, 198, 174, 0.11);
}

.bg-orb-left {
  left: clamp(-280px, -19vw, -160px);
  bottom: clamp(-190px, -12vw, -100px);
}

.bg-orb-right {
  right: clamp(-300px, -20vw, -170px);
  bottom: clamp(-170px, -11vw, -90px);
}

.bg-track {
  position: absolute;
  width: clamp(220px, 26vw, 330px);
  aspect-ratio: 2.05 / 1;
  border-top: 1px dashed rgba(181, 153, 128, 0.28);
  border-radius: 50%;
}

.bg-track-left {
  left: -30px;
  bottom: clamp(45px, 7vh, 80px);
  transform: rotate(14deg);
}

.bg-track-right {
  right: -8px;
  bottom: clamp(90px, 13vh, 135px);
  transform: rotate(-18deg);
}

/* CARD */
.signup-card {
  width: var(--card-width);
  border: 1px solid rgba(199, 183, 167, 0.72);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

/* BRAND */
.brand-wrap {
  display: flex;
  justify-content: center;
  padding: clamp(18px, 2.8vh, 30px) var(--inner-x) clamp(5px, 0.9vh, 10px);
}

.brand-logo {
  display: block;
  width: min(100%, clamp(290px, 34vw, 360px));
  height: auto;
}

/* HEADER */
.signup-header {
  padding: clamp(2px, 0.6vh, 6px) var(--inner-x) clamp(11px, 1.8vh, 19px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 clamp(5px, 0.8vh, 8px);
  color: #b68a6d;
  font-size: clamp(10px, 0.8vw, 11px);
  font-weight: 800;
  letter-spacing: 0.22em;
}

.signup-header h1 {
  margin: 0;
  font-size: clamp(29px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.signup-header p:last-child {
  margin: clamp(7px, 1vh, 10px) 0 0;
  color: var(--text-soft);
  font-size: clamp(12px, 1.15vw, 14px);
  line-height: 1.55;
}

/* FORM */
.signup-form {
  margin: 0 var(--inner-x);
  padding: clamp(13px, 1.8vh, 21px) 0 clamp(15px, 2.2vh, 24px);
  border-top: 1px solid rgba(218, 205, 193, 0.72);
}

.field-group + .field-group {
  margin-top: var(--field-gap);
}

.field-group label {
  display: inline-block;
  margin: 0 0 clamp(4px, 0.6vh, 7px);
  color: #4d3a31;
  font-size: clamp(13px, 1vw, 14px);
  font-weight: 750;
}

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

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

.input-icon {
  position: absolute;
  left: clamp(13px, 1.4vw, 16px);
  width: clamp(18px, 1.5vw, 20px);
  height: clamp(18px, 1.5vw, 20px);
  fill: none;
  stroke: #9d9087;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  height: var(--input-height);
  padding: 0 clamp(46px, 4vw, 52px) 0 clamp(43px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: clamp(10px, 1vw, 12px);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  font-size: clamp(14px, 1.15vw, 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 clamp(2px, 0.35vw, 4px) rgba(216, 79, 117, 0.09);
}

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

/* PASSWORD */
.password-toggle {
  position: absolute;
  right: clamp(7px, 0.8vw, 11px);
  display: grid;
  place-items: center;
  width: clamp(34px, 3vw, 38px);
  aspect-ratio: 1;
  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: clamp(19px, 1.6vw, 21px);
  height: clamp(19px, 1.6vw, 21px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.password-hint-row {
  display: flex;
  justify-content: space-between;
  min-height: clamp(14px, 1.7vh, 18px);
  margin-top: clamp(2px, 0.45vh, 5px);
  color: #a0938a;
  font-size: 11px;
}

.password-hint-row .valid {
  color: var(--success);
}

/* ERROR / MESSAGE */
.field-error {
  min-height: clamp(12px, 1.5vh, 16px);
  margin: clamp(1px, 0.35vh, 4px) 0 0;
  color: var(--error);
  font-size: 12px;
}

.form-message {
  min-height: clamp(15px, 1.8vh, 20px);
  margin: clamp(4px, 0.8vh, 9px) 0 clamp(2px, 0.4vh, 5px);
  text-align: center;
  color: var(--error);
  font-size: 13px;
}

.form-message.success {
  color: var(--success);
}

.legal-consents {
  margin: clamp(10px, 1.5vh, 16px) 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.legal-consents legend {
  padding: 0 6px;
  color: #4d3a31;
  font-size: 13px;
  font-weight: 800;
}

.legal-consents label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 9px 0 0;
  color: #62534a;
  font-size: 12px;
  line-height: 1.45;
}

.legal-consents input {
  margin-top: 2px;
  accent-color: var(--pink);
}

.legal-consents a {
  color: var(--pink);
  font-weight: 750;
}

.legal-consents small {
  color: #9a8c83;
}

.legal-consent-status {
  margin: 0 0 4px;
  color: #897970;
  font-size: 11px;
}

/* PRIMARY BUTTON */
.primary-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: var(--button-height);
  border: 0;
  border-radius: clamp(10px, 1vw, 12px);
  color: #fff;
  background: linear-gradient(135deg, #df5b7f, #cf476d);
  box-shadow: 0 clamp(7px, 1vh, 10px) clamp(18px, 2.4vh, 24px) rgba(208, 70, 106, 0.18);
  font-size: clamp(15px, 1.2vw, 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 clamp(9px, 1.3vh, 13px) clamp(22px, 3vh, 30px) rgba(208, 70, 106, 0.24);
  filter: saturate(1.04);
}

.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;
  animation: spin 800ms linear infinite;
}

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

.primary-button.loading .button-spinner {
  opacity: 1;
}

.signup-note {
  margin: clamp(7px, 1vh, 13px) 12px 0;
  color: #9a8c83;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

/* LOGIN LINK */
.login-row {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: clamp(12px, 1.7vh, 18px) 24px clamp(13px, 1.9vh, 20px);
  border-top: 1px solid rgba(218, 205, 193, 0.72);
  color: #93857c;
  font-size: 13px;
}

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

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

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

/* MOBILE */
@media (max-width: 680px) {
  :root {
    --card-width: min(100%, 560px);
    --inner-x: clamp(20px, 6vw, 28px);
    --input-height: clamp(47px, 6.2vh, 52px);
  }

  .signup-page {
    place-items: start center;
    overflow-y: auto;
  }

  .signup-card {
    margin-top: clamp(0px, 1vh, 8px);
  }

  .brand-wrap {
    padding-top: clamp(20px, 3vh, 27px);
  }

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

  .signup-header h1 {
    font-size: clamp(29px, 9vw, 36px);
  }

  .login-row {
    flex-wrap: wrap;
  }
}

/* 화면 높이가 매우 짧을 때만 최소 보정 */
@media (max-height: 690px) and (min-width: 681px) {
  :root {
    --page-pad-y: 8px;
    --field-gap: 5px;
    --input-height: 44px;
    --button-height: 46px;
  }

  .brand-wrap {
    padding-top: 10px;
    padding-bottom: 2px;
  }

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

  .signup-header {
    padding-bottom: 8px;
  }

  .signup-form {
    padding-top: 9px;
    padding-bottom: 11px;
  }

  .field-error {
    min-height: 10px;
  }

  .login-row {
    padding-top: 9px;
    padding-bottom: 10px;
  }
}

@media (min-width: 681px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .signup-page {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    padding-top: clamp(8px, 1.5vh, 18px);
    padding-bottom: clamp(8px, 1.5vh, 18px);
    overflow: visible;
  }
}
