/* ─── Reset & base ─────────────────────────────────────────── */
:root { color-scheme: light; }

*,
*::before,
*::after { box-sizing: border-box; }

html {
  height: 100%;
  background: #e3e3e3;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
    'Segoe UI', Arial, Roboto, 'PingFang SC', miui, 'Hiragino Sans GB',
    'Microsoft Yahei', sans-serif;
  min-height: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
  background: #fbf1d8;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
}

/* ─── Site header ────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}

.logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
}

/* ─── Card wrap ──────────────────────────────────────────────── */
.card-wrap {
  flex: 1;
  padding: 0 12px 16px;
  overflow-y: auto;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 12px 12px 24px;
  box-shadow: 0 -6px 32px 0 rgba(0,0,0,.12), 0 4px 16px 0 rgba(0,0,0,.08);
}

/* ─── Tab nav ────────────────────────────────────────────────── */
.tab-nav {
  position: relative;
  display: flex;
  border-bottom: 1px solid #e3e3e3;
  margin: 0 0 10px;
}

.tab {
  flex: 1;
  text-align: center;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  color: #252222;
  padding: 0 0 16px;
  cursor: pointer;
  position: relative;
}

.tab-active { color: #c48540; }

.tab-bar {
  position: absolute;
  bottom: 0;
  left: 25%;
  transform: translateX(-50%);
  height: 3px;
  width: 60px;
  background: #c48540;
  border-radius: 9999px;
}

/* ─── Form title ─────────────────────────────────────────────── */
.form-title {
  font-size: 18px;
  font-weight: 700;
  color: #c48540;
  text-align: center;
  padding: 0 0 12px;
  margin: 0 0 10px;
}

/* ─── Form items ─────────────────────────────────────────────── */
.form-item { margin-bottom: 10px; }

label {
  display: block;
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  color: #252222;
  margin-bottom: 3px;
}

/* ─── Form control ───────────────────────────────────────────── */
.form-control {
  display: flex;
  align-items: center;
  height: 35px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  background: #fff;
  padding: 0 8px;
  transition: border-color 0.2s;
}

.form-control:focus-within { border-color: #c48540; }
.form-control.has-error     { border-color: #f87171; }

.fc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #999999;
  flex-shrink: 0;
  margin-right: 4px;
}

.fc-icon svg { width: 14px; height: 14px; }

.fc-star {
  color: #ef4444;
  font-size: 12px;
  line-height: 1;
  margin-right: 4px;
  flex-shrink: 0;
}

.form-control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: #333333;
  font-family: inherit;
}

.form-control input::placeholder { color: #999999; }

/* ─── Eye toggle ─────────────────────────────────────────────── */
.eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: transparent;
  color: #e3e3e3;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  margin-left: 4px;
}

.eye-btn:hover { color: #bbbbbb; }

.icon-eye { width: 14px; height: 14px; display: block; }
.icon-eye-on { display: none; }

/* ─── Phone prefix ───────────────────────────────────────────── */
.fc-prefix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-right: 4px;
}

.flag-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
}

.prefix-num {
  font-size: 12px;
  font-weight: 400;
  color: #999999;
}

.prefix-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: #e0d5b8;
  margin: 0 2px;
}

/* ─── Password strength ──────────────────────────────────────── */
.strength-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 0 4px;
}

.strength-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #252222;
  white-space: nowrap;
}

.strength-bar {
  display: inline-block;
  height: 4px;
  width: 24px;
  border-radius: 9999px;
  background: #e3e3e3;
  opacity: 0.8;
  transition: background 0.2s;
}

.strength-bar.s1 { background: #ea4e3d; }
.strength-bar.s2 { background: #ffaa09; }
.strength-bar.s3 { background: #c48540; }
.strength-bar.s4 { background: #04be02; }

/* ─── Field error ────────────────────────────────────────────── */
.field-error {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 4px 4px 0;
  font-size: 12px;
  line-height: 16px;
  color: #ef4444;
}

.field-error.visible { display: flex; }

.error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ea4e3d;
  flex-shrink: 0;
}

.error-icon svg { width: 8px; height: 8px; }

/* ─── Hint text ──────────────────────────────────────────────── */
.hint-text {
  margin: 4px 4px 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #ffaa09;
}

/* ─── Agreed ─────────────────────────────────────────────────── */

.agreed-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 0;
  padding-top: 6px;
}

.checkbox-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #cccccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
  margin-top: 1px;
}

.checkbox-btn.checked {
  background: #04be02;
  border-color: #04be02;
}

.check-mark {
  width: 9px;
  height: 8px;
  display: none;
}

.agreed-text {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #666666;
}

.agreed-link { color: #c48540; }

/* ─── Submit button ──────────────────────────────────────────── */
#submitBtn {
  display: block;
  width: 100%;
  height: 33px;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: #c48540;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  animation: pulse-scale 1.5s ease-in-out infinite;
  transition: box-shadow 0.3s, transform 0.3s;
}

#submitBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  animation: none;
}

/* ─── Global API error ───────────────────────────────────────── */
#error {
  display: none;
  margin: 0 4px 8px;
  color: #ef4444;
  font-size: 12px;
  line-height: 16px;
}

#error.visible { display: block; }

/* ─── Form footer ────────────────────────────────────────────── */
.footer-links {
  display: flex;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.footer-links li {
  flex: 1;
  display: flex;
  justify-content: center;
}

.footer-link {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #c48540;
  cursor: pointer;
}

.footer-link:hover { opacity: 0.8; }

.footer-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.div-line {
  display: block;
  width: 32px;
  border-top: 2px solid #e3e3e3;
  opacity: 0.5;
}

.div-text {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #999999;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.social-btn:hover  { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.social-btn:active { transform: scale(0.95); }

.social-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── Pulse animation ────────────────────────────────────────── */
@keyframes pulse-scale {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255,255,255,0);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 24px 12px rgba(255,255,255,.5);
  }
}
