:root {
  --primary-color: #75acff;
  --primary-hover-color: #5d9cff;
  --background-color: #f7f8fa;
  --text-main-color: #191f28;
  --text-sub-color: #6b7684;
  --text-label-color: #4e5968;
  --border-color: #d9dee8;
  --danger-color: #e5484d;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Login */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--background-color);
}

.login-card {
  width: min(420px, 100%);
  background: #ffffff;
  border-radius: 28px;
  padding: 36px 28px 32px;
  box-shadow: var(--shadow-card);
  transition:
    width 0.3s ease,
    padding 0.3s ease;
}

.logo-area {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.logo {
  width: 220px;
  height: auto;
}

.title-area {
  margin-bottom: 28px;
}

#loginGuide {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main-color);
  line-height: 1.3;
  letter-spacing: -0.3px;
}

#loginGuide.hidden {
  display: none;
}

#loginSubGuide {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-sub-color);
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-step {
  display: none;
}

.form-step.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-label-color);
}

.login-form input {
  height: 52px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0 16px;
  font-size: 17px;
}

.login-form input:focus {
  border-color: var(--primary-color);
}

.primary-button {
  height: 52px;
  border-radius: 14px;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--primary-hover-color);
}

.primary-button:disabled {
  opacity: 0.55;
}

.text-button {
  height: 44px;
  background: transparent;
  color: var(--text-sub-color);
  font-size: 14px;
  font-weight: 700;
}

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

.signup-message {
  margin: 0 0 8px;
  color: var(--text-sub-color);
  font-size: 15px;
  text-align: center;
}

.code-input-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.code-input {
  width: 42px !important;
  height: 48px !important;
  padding: 0 !important;
  text-align: center;
  font-size: 22px !important;
  font-weight: 800;
  border-radius: 12px;
}

/* ── Signup ──────────────────────────── */

.signup-card {
  width: min(480px, 100%);
  padding: 32px 28px 28px;
  border-radius: 24px;
}

.card-transitioning {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.card-entering {
  animation: cardEnter 0.3s ease forwards;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.signup-step {
  display: flex;
  flex-direction: column;
}

/* 헤더 영역 */
.signup-step-header {
  margin-bottom: 28px;
}

.signup-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  padding: 0;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub-color);
  cursor: pointer;
  transition: color 0.12s;
}

.signup-back-btn:hover {
  color: var(--text-main-color);
}

.signup-back-btn::before {
  content: "←";
  font-size: 15px;
}

.signup-step-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main-color);
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.signup-step-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub-color);
  line-height: 1.5;
}

/* 업체 유형 선택 카드 */
.signup-type-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.signup-type-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 18px 18px;
  border: 1.5px solid #e5e8eb;
  border-radius: 16px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.signup-type-card:hover {
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.1);
  background: #f8fbff;
}

.signup-type-card:active {
  background: #eef5ff;
}

.signup-type-icon {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  background: #f2f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.signup-type-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.signup-type-text strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main-color);
}

.signup-type-text span {
  font-size: 13px;
  color: var(--text-sub-color);
}

.signup-type-arrow {
  color: #c9cdd4;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
}

/* 폼 영역 */
.signup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.signup-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.signup-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-label-color);
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.signup-verified-badge {
  font-size: 11px;
  font-weight: 600;
  color: #00b660;
  background: #e6f9f0;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0;
}

.signup-input-readonly {
  background: #f2f4f6;
  color: var(--text-sub-color);
  cursor: default;
}

.signup-optional {
  font-size: 11px;
  font-weight: 600;
  color: #8b95a1;
  background: #f2f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0;
}

.signup-input {
  height: 50px;
  border: 1.5px solid #e5e8eb;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main-color);
  background: #ffffff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.signup-input:focus {
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
  outline: none;
}

.signup-input::placeholder {
  color: #c9cdd4;
}

.signup-address-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid #e5e8eb;
  border-radius: 12px;
  background: #f9fafb;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.signup-address-btn:hover {
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}

.signup-address-btn span {
  font-size: 15px;
  color: #c9cdd4;
  font-family: inherit;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signup-address-btn span.has-value {
  color: var(--text-main-color);
}

.signup-address-btn::after {
  content: "›";
  margin-left: 8px;
  color: #c9cdd4;
  font-size: 18px;
  font-weight: 300;
  flex: 0 0 auto;
}

/* 리스트 (업체/지점 선택) */
.verify-phone-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.verify-send-btn {
  height: 50px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid #3182f6;
  background: #ffffff;
  color: #3182f6;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s;
}

.verify-send-btn:hover {
  background: #f0f6ff;
}
.verify-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.verify-timer {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub-color);
  text-align: center;
}

.signup-search-wrap {
  margin-bottom: 10px;
}

.signup-search-input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 40px;
  border: 1.5px solid #e5e8eb;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main-color);
  background: #f9fafb
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c9cdd4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E")
    no-repeat 14px center;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  box-sizing: border-box;
}

.signup-search-input:focus {
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
  outline: none;
}

.signup-search-input::placeholder {
  color: #c9cdd4;
}

.signup-list-wrap {
  margin-bottom: 20px;
}

.signup-list-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub-color);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.signup-list {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow-y: auto;
  border: 1.5px solid #e5e8eb;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  overflow-y: auto;
}

.signup-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 18px;
  background: #ffffff;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main-color);
  border: none;
  border-bottom: 1px solid #f2f4f6;
  transition: background 0.1s;
  cursor: pointer;
}

.signup-list-item:last-child {
  border-bottom: none;
}

.signup-list-item:hover {
  background: #f8fbff;
}

.signup-list-item:active {
  background: #eef5ff;
}

.signup-list-item.selected {
  background: #eef5ff;
  color: #3182f6;
}

.signup-list-item-arrow {
  color: #c9cdd4;
  font-size: 18px;
  font-weight: 300;
  flex: 0 0 auto;
}

.signup-list-new {
  color: #3182f6;
  font-weight: 700;
}

.signup-list-new .signup-list-item-arrow {
  color: #3182f6;
  opacity: 0.5;
}

.signup-list-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-sub-color);
}

/* 섹션 구분 */
.similar-company-warning {
  margin-bottom: 16px;
  border: 1.5px solid #f0b429;
  border-radius: 14px;
  background: #fffbec;
  overflow: hidden;
}

.similar-collapsed {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
}

.similar-toggle-btn {
  font-size: 12px;
  font-weight: 700;
  color: #3182f6;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.similar-expanded {
  padding: 16px;
}

.similar-company-title {
  font-size: 14px;
  font-weight: 800;
  color: #b45309;
  margin: 0 0 4px;
}

.similar-company-sub {
  font-size: 13px;
  color: #92400e;
  margin: 0 0 10px;
}

.similar-company-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.similar-company-item {
  font-size: 14px;
  font-weight: 700;
  color: #1c1917;
  padding: 8px 12px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #fde68a;
}

.similar-company-actions {
  display: flex;
  gap: 8px;
}

.similar-btn-existing {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid #3182f6;
  background: #ffffff;
  color: #3182f6;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}

.similar-btn-existing:hover {
  background: #f0f6ff;
}

.similar-btn-confirm {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}

.similar-btn-confirm:hover {
  background: #e5e8eb;
}

/* 가입 페이지 주소 다이얼로그 고정 크기 */
[data-signup-shell] .address-dialog-card {
  height: 560px;
  max-height: 82vh;
}

[data-signup-shell] .address-dialog-card .address-result-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

[data-signup-shell] .address-dialog-card .selected-address-box {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.address-dialog-footer {
  flex: 0 0 auto;
  padding: 12px 20px;
  border-top: 1px solid #edf0f4;
  background: #ffffff;
}

.address-dialog-footer.hidden {
  display: none;
}

.address-apply-button {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: #3182f6;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.12s;
}

.address-apply-button:hover {
  background: #1b64da;
}

.signup-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.signup-section-divider {
  height: 1px;
  background: #f2f4f6;
  margin: 4px 0 4px;
}

/* 에러 */
.signup-error {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #f04452;
  line-height: 1.4;
}

.signup-error.hidden {
  display: none;
}

/* 액션 버튼 영역 */
.signup-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.signup-actions .primary-button {
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  background: #3182f6;
  letter-spacing: -0.2px;
}

.signup-actions .primary-button:hover {
  background: #1b64da;
}

.signup-actions .primary-button:disabled {
  opacity: 0.5;
}

.signup-back-text-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #8b95a1;
  cursor: pointer;
  transition: color 0.12s;
}

.signup-back-text-btn:hover {
  color: var(--text-main-color);
}

/* ── 약관 동의 (토스 스타일 플랫 리스트) ──────────────────────────── */

.term-all-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 16px;
  margin-top: 4px;
  cursor: pointer;
}

.term-all-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.term-all-text strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main-color);
  letter-spacing: -0.2px;
}

.term-all-text span {
  font-size: 12.5px;
  color: var(--text-sub-color);
  line-height: 1.4;
}

.term-rows {
  display: flex;
  flex-direction: column;
  background: #fafbfc;
  border-radius: 14px;
  padding: 2px 14px;
  margin-top: 4px;
}

.term-rows-info {
  margin-bottom: 4px;
}

.term-gap-label {
  font-size: 12px;
  font-weight: 700;
  color: #b0b8c1;
  letter-spacing: 0.3px;
  margin: 18px 2px 6px;
}

.term-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #eef0f3;
}

.term-rows > .term-row:last-child {
  border-bottom: none;
}

.term-row-check {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.term-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  border: 2px solid #d9dee8;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.term-checkbox-all {
  width: 24px;
  height: 24px;
}

.term-checkbox:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.term-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: translate(-50%, -62%) rotate(45deg);
}

.term-checkbox-all:checked::after {
  width: 6px;
  height: 11px;
}

.term-tag {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
}

.term-tag-required {
  color: #3182f6;
}

.term-tag-info {
  color: #b0b8c1;
}

.term-row-label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main-color);
  line-height: 1.4;
  min-width: 0;
}

.term-row-info .term-row-label {
  color: var(--text-sub-color);
  font-weight: 500;
}

.term-row-view {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 4px 0 10px;
  background: transparent;
  border: none;
  color: #8b95a1;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.12s;
}

.term-row-view:hover {
  color: #3182f6;
}

.term-actions {
  margin-top: 28px;
}

/* ── 약관 보기 모달 ──────────────────────────── */

.term-viewer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
}

.term-viewer-backdrop.active {
  display: flex;
}

.term-viewer-card {
  width: min(720px, 94vw);
  height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.term-viewer-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 18px;
  border-bottom: 1px solid #edf0f4;
}

.term-viewer-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.term-viewer-eyebrow {
  font-size: 12px;
  font-weight: 800;
  color: #3182f6;
  letter-spacing: 0.3px;
}

.term-viewer-heading h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main-color);
  letter-spacing: -0.3px;
}

.term-viewer-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f2f4f6;
  border: none;
  color: var(--text-main-color);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s;
}

.term-viewer-close:hover {
  background: #e5e8eb;
}

.term-viewer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 32px 30px;
}

.term-viewer-footer {
  flex: 0 0 auto;
  padding: 16px 28px;
  border-top: 1px solid #edf0f4;
  background: #ffffff;
}

.term-viewer-confirm-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}

.term-viewer-confirm-btn:hover {
  background: var(--primary-hover-color);
}

.term-content {
  max-width: 640px;
  margin: 0 auto;
}

.term-content h1 {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: 900;
  color: var(--text-main-color);
  letter-spacing: -0.3px;
}

.term-content h1:not(:first-child) {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid #edf0f4;
}

.term-content h2 {
  margin: 26px 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main-color);
}

.term-content h2:first-of-type {
  margin-top: 0;
}

.term-content p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-label-color);
}

.term-content ol,
.term-content ul {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-label-color);
}

.term-content li {
  margin-bottom: 6px;
}

.term-content li ul {
  margin: 6px 0 0;
}

.term-table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
}

.term-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.term-table th,
.term-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  vertical-align: top;
  color: var(--text-label-color);
  line-height: 1.5;
}

.term-table th {
  background: #f9fafb;
  font-weight: 800;
  color: var(--text-main-color);
  white-space: nowrap;
}

.term-table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 560px) {
  .term-viewer-backdrop {
    padding: 0;
  }

  .term-viewer-card {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .term-viewer-header {
    padding: 20px 20px 16px;
  }

  .term-viewer-body {
    padding: 20px 20px 24px;
  }

  .term-viewer-footer {
    padding: 14px 20px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}
