:root {
  --ka-bg: #f7f1f1;
  --ka-surface: #ffffff;
  --ka-soft: #f7f8fc;
  --ka-ink: #281719;
  --ka-muted: #756568;
  --ka-border: #ead9da;
  --ka-primary: #7a1f28;
  --ka-primary-deep: #54151c;
  --ka-accent: #b63c48;
  --ka-success: #0f9f6e;
  --ka-danger: #d83b64;
  --ka-shadow: 0 24px 70px rgba(29, 38, 65, .12);
}

.koco-auth-page,
.koco-auth-page * {
  box-sizing: border-box;
}

.koco-auth-page [hidden] {
  display: none !important;
}

.koco-auth-page {
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 0 0 40px;
  position: relative;
  color: var(--ka-ink);
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.koco-auth-page::before,
.koco-auth-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.koco-auth-page::before {
  width: 520px;
  height: 520px;
  left: -180px;
  top: -180px;
  background: radial-gradient(circle, rgba(122, 31, 40, .14), rgba(122, 31, 40, 0) 67%);
}

.koco-auth-page::after {
  width: 480px;
  height: 480px;
  right: -170px;
  bottom: -190px;
  background: radial-gradient(circle, rgba(182, 60, 72, .11), rgba(182, 60, 72, 0) 67%);
}

.koco-auth-page a {
  color: inherit;
  text-decoration: none;
}

.koco-auth-page button,
.koco-auth-page input {
  font: inherit;
}

.koco-auth-page a:focus-visible,
.koco-auth-page button:focus-visible,
.koco-auth-page input:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .28);
  outline-offset: 3px;
}

.koco-auth-brandbar {
  min-height: 72px;
  padding: 13px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(224, 230, 239, .95);
  border-radius: 20px;
  box-shadow: 0 12px 35px rgba(29, 38, 65, .07);
  backdrop-filter: blur(16px);
}

.koco-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.koco-auth-brandmark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--ka-primary), var(--ka-accent));
  box-shadow: 0 9px 22px rgba(79, 70, 229, .25);
  font-size: 26px;
  font-weight: 900;
}

.koco-auth-brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.koco-auth-brand strong {
  font-size: 22px;
  letter-spacing: -.035em;
}

.koco-auth-brand small {
  margin-top: 5px;
  color: var(--ka-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.koco-auth-home {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ka-border);
  border-radius: 12px;
  background: #fff;
  color: #495367;
  font-size: 12px;
  font-weight: 800;
}

.koco-auth-home:hover {
  color: var(--ka-primary);
  border-color: #e2b5b9;
  background: #fbf0f1;
}

.koco-auth-panel {
  margin-top: 22px;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  position: relative;
  background: var(--ka-surface);
  border: 1px solid var(--ka-border);
  border-radius: 28px;
  box-shadow: var(--ka-shadow);
}

.koco-auth-panel::after {
  content: "*";
  position: absolute;
  right: -12px;
  top: -72px;
  color: rgba(79, 70, 229, .045);
  font-size: 280px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.koco-auth-intro {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.koco-auth-intro > span {
  color: var(--ka-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.koco-auth-intro h1 {
  margin: 8px 0 0;
  font-size: clamp(31px, 5vw, 49px);
  line-height: 1.08;
  letter-spacing: -.055em;
}

.koco-auth-intro p {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--ka-muted);
  font-size: 14px;
  word-break: keep-all;
}

.koco-auth-columns {
  margin-top: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 28px;
  position: relative;
  z-index: 1;
}

.koco-auth-section {
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--ka-border);
  border-radius: 20px;
  background: var(--ka-soft);
}

.koco-auth-section-head {
  margin-bottom: 21px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.koco-auth-step {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--ka-primary), var(--ka-primary-deep));
  font-size: 10px;
  font-weight: 900;
}

.koco-auth-section-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -.035em;
}

.koco-auth-section-head p {
  margin: 4px 0 0;
  color: var(--ka-muted);
  font-size: 11px;
}

.koco-auth-divider {
  width: 1px;
  min-height: 100%;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--ka-border);
}

.koco-auth-divider span {
  padding: 7px 0;
  color: var(--ka-muted);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  writing-mode: vertical-rl;
}

.koco-auth-form {
  display: grid;
  gap: 10px;
}

.koco-auth-form + .koco-auth-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--ka-border);
}

.koco-auth-form label {
  color: #3f485c;
  font-size: 11px;
  font-weight: 850;
}

.koco-auth-form label small {
  margin-left: 5px;
  color: var(--ka-muted);
  font-size: 9px;
  font-weight: 700;
}

.koco-auth-form input[type="text"],
.koco-auth-form input[type="email"],
.koco-auth-form input[type="password"] {
  width: 100%;
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid #d5dce7;
  border-radius: 12px;
  outline: none;
  color: var(--ka-ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.koco-auth-form input::placeholder {
  color: #a3adbb;
}

.koco-auth-form input:focus {
  border-color: #c98289;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .09);
}

.koco-auth-form input[readonly] {
  color: #566174;
  background: #eef1f6;
}

.koco-auth-check {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.koco-auth-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--ka-primary);
}

.koco-auth-primary,
.koco-auth-secondary {
  min-height: 49px;
  padding: 0 17px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.koco-auth-primary {
  color: #fff;
  border: 1px solid var(--ka-primary);
  background: linear-gradient(135deg, var(--ka-primary), var(--ka-primary-deep));
  box-shadow: 0 10px 22px rgba(79, 70, 229, .20);
}

.koco-auth-secondary {
  color: var(--ka-primary);
  border: 1px solid #e2b5b9;
  background: #f2f1ff;
}

.koco-auth-primary:hover,
.koco-auth-secondary:hover {
  transform: translateY(-1px);
}

.koco-auth-primary:disabled,
.koco-auth-secondary:disabled {
  transform: none;
  opacity: .55;
  cursor: wait;
}

.koco-auth-message {
  min-height: 39px;
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  color: #4c576b;
  background: #eef1f6;
  font-size: 10px;
  font-weight: 700;
}

.koco-auth-message.is-working {
  color: #6b4d00;
  background: #fff6d9;
}

.koco-auth-message.is-success {
  color: #087653;
  background: #e9faf3;
}

.koco-auth-message.is-error {
  color: #ad254d;
  background: #fff0f4;
}

.koco-auth-helpbar {
  margin-top: 26px;
  padding: 17px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--ka-border);
  border-radius: 15px;
  background: #fff;
}

.koco-auth-helpbar > div {
  display: flex;
  flex-direction: column;
}

.koco-auth-helpbar strong {
  font-size: 12px;
}

.koco-auth-helpbar span {
  margin-top: 2px;
  color: var(--ka-muted);
  font-size: 10px;
}

.koco-auth-helpbar > a {
  min-height: 39px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  color: var(--ka-primary);
  background: #f2f1ff;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.koco-auth-security {
  margin: 17px 0 0;
  position: relative;
  z-index: 1;
  color: var(--ka-muted);
  text-align: center;
  font-size: 9px;
}

.koco-auth-page-compact {
  max-width: 900px;
}

.koco-auth-setup-panel {
  max-width: 790px;
  margin-right: auto;
  margin-left: auto;
}

.koco-identity-lock {
  margin-top: 31px;
  padding: 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  position: relative;
  z-index: 1;
  color: #fff;
  background: linear-gradient(135deg, #361318, #8f2937);
  border-radius: 18px;
}

.koco-identity-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #312e81;
  background: #fff;
  font-weight: 900;
}

.koco-identity-lock small {
  display: block;
  color: rgba(255, 255, 255, .67);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.koco-identity-lock strong {
  margin-top: 2px;
  display: block;
  font-size: 22px;
  letter-spacing: -.04em;
}

.koco-identity-lock p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
}

.koco-identity-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
}

.koco-auth-setup-form,
.koco-reset-flow {
  margin-top: 27px;
  padding: 25px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--ka-border);
  border-radius: 20px;
  background: var(--ka-soft);
}

.koco-auth-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.koco-auth-field-grid > div {
  display: grid;
  gap: 10px;
}

.koco-auth-field-help {
  margin: 0 0 8px;
  color: var(--ka-muted);
  font-size: 10px;
}

.koco-auth-wide {
  width: 100%;
  margin-top: 5px;
}

.koco-reset-password-form {
  margin-top: 22px;
  padding-top: 22px;
}

@media (max-width: 760px) {
  .koco-auth-page {
    width: calc(100% - 20px);
    min-height: calc(100vh - 20px);
    margin: 10px auto;
  }

  .koco-auth-brandbar {
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 17px;
  }

  .koco-auth-brandmark {
    width: 39px;
    height: 39px;
    border-radius: 13px;
  }

  .koco-auth-brand small {
    display: none;
  }

  .koco-auth-panel {
    margin-top: 12px;
    padding: 28px 20px;
    border-radius: 21px;
  }

  .koco-auth-columns {
    margin-top: 27px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .koco-auth-divider {
    width: 100%;
    min-height: 1px;
  }

  .koco-auth-divider span {
    padding: 0 9px;
    writing-mode: horizontal-tb;
  }

  .koco-auth-section,
  .koco-auth-setup-form,
  .koco-reset-flow {
    padding: 20px;
    border-radius: 17px;
  }

  .koco-auth-helpbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .koco-auth-helpbar > a {
    width: 100%;
    justify-content: center;
  }

  .koco-identity-lock {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .koco-identity-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .koco-auth-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .koco-auth-home {
    padding: 0 10px;
  }

  .koco-auth-intro h1 {
    font-size: 32px;
  }

  .koco-auth-section-head {
    align-items: center;
  }

  .koco-auth-section,
  .koco-auth-setup-form,
  .koco-reset-flow {
    padding: 17px;
  }

  .koco-live-metrics {
    grid-template-columns: 1fr;
  }
}
