* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: #fff;
  min-height: 100dvh;
  color: #1a1a1a;
}

.phone {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  background: #fff;
  margin: 0 auto;
}

.screen {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  padding: max(24px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }

@media (min-width: 768px) {
  body { background: #fff; }
  .phone { max-width: none; }

  .screen:not(.welcome) {
    max-width: 780px;
    margin: 0 auto;
    padding: 48px 64px 40px;
  }
  .screen.welcome { max-width: none; width: 100%; }
  .welcome-inner { max-width: 780px; margin: 0 auto; }

  .topbar { padding: 8px 0 24px; }
  .topbar h2 { font-size: 20px; text-align: left; flex: 0 1 auto; }

  .content { padding-bottom: 48px; }
  .content.top { padding-top: 8px; }

  h1 { font-size: 40px; }
  .terms { font-size: 18px; max-width: 460px; }
  .hint { font-size: 18px; max-width: 640px; }

  .card-form { max-width: 640px; padding: 32px 28px; gap: 20px; }
  .field-input { height: 66px; font-size: 18px; }

  .review-card { max-width: 640px; padding: 8px 28px; }
  .review-row .val { font-size: 18px; }
  .review-row .lbl { font-size: 14px; }

  .btn-continue { max-width: 460px; height: 62px; font-size: 18px; }
  .home-btn { max-width: 460px; }

  .card-placeholder { max-width: 420px; }

  .otrc-card { max-width: 640px; padding: 32px 28px; }
  .otrc-box { width: 44px; height: 44px; font-size: 20px; }
  .otrc-prefix { font-size: 22px; }

  .info { max-width: 660px; }
  .info h3 { font-size: 22px; }
  .info p, .info li, .help-list li { font-size: 18px; }
  .help-card { max-width: 420px; }

}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
}
.topbar h2 {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.back, .spacer { width: 36px; height: 36px; }
.grow { flex: 1; }
.back {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; border-radius: 50%;
}
.back:active { background: rgba(0,0,0,.05); }

.screen.welcome {
  justify-content: space-between;
  padding: 0;
  background: #fff;
  overflow: hidden;
}

.welcome-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: max(40px, env(safe-area-inset-top)) 24px 0;
}
.brand-mark {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #2b2b2b;
  margin-bottom: 56px;
}
.brand-mark span { color: #9c8d7b; }

.card-stage {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 1.586 / 1;
}
.wcard {
  position: absolute;
  inset: 0;
  border-radius: 20px;
}
.wcard-back {
  transform: rotate(-8deg) translateY(-14px);
  background: linear-gradient(145deg, #b8ab99, #9c8d7b);
  box-shadow: 0 20px 45px rgba(90,78,64,.35);
}
.wcard-front {
  transform: rotate(4deg);
  background: linear-gradient(150deg, #3a3a3a 0%, #1c1c1c 100%);
  box-shadow: 0 26px 55px rgba(0,0,0,.4);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.wcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wcard-brand { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.wcard-brand span { color: #c9beb0; }
.wcard-contactless {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  border-left-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(45deg);
}
.wcard-chip {
  width: 40px; height: 30px;
  border-radius: 6px;
  margin-top: 22px;
  background: linear-gradient(135deg, #e8d9a8, #c9b071);
}
.wcard-number {
  display: flex;
  gap: 14px;
  margin-top: auto;
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(255,255,255,.85);
}
.wcard-number span:not(.live)::before { content: "••••"; letter-spacing: 1px; }
.wcard-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255,255,255,.7);
}

.welcome-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 28px max(36px, env(safe-area-inset-bottom));
}
.welcome-title {
  color: #2b2b2b;
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  text-align: center;
}
.welcome-sub {
  color: #6b6357;
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  max-width: 320px;
  margin-bottom: 8px;
}
.welcome-btn {
  max-width: 460px;
  background: #2b2b2b;
  color: #f2f1ef;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 40px;
}
.content.top { justify-content: flex-start; padding-top: 24px; }

.cards-icon { margin-bottom: 40px; }
.cards-icon img { width: clamp(160px, 45vw, 220px); height: auto; display: block; }

h1 {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 600;
  letter-spacing: -.3px;
  margin-bottom: 20px;
}

.terms {
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1.6;
  color: #8a8a8a;
  max-width: 300px;
}
.terms a { color: #8a8a8a; text-decoration: underline; }

.hint {
  width: 100%;
  text-align: left;
  font-size: 15px;
  line-height: 1.55;
  color: #6b6b6b;
  margin-bottom: 14px;
}

.card-form {
  width: 100%;
  background: #fff;
  border-radius: 26px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field-input {
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 30px;
  background: #efeef1;
  padding: 0 24px;
  font-size: 16px;
  color: #1a1a1a;
  outline: none;
}
.field-input::placeholder { color: #9a9a9a; }
.field-input:focus { box-shadow: inset 0 0 0 2px #d5d4da; }

.field-group { display: flex; flex-direction: column; }
.field-error {
  font-size: 13px;
  color: #d9463e;
  padding: 6px 4px 0;
  min-height: 0;
  display: none;
}
.field-group.invalid .field-error { display: block; }
.field-group.invalid .field-input { box-shadow: inset 0 0 0 2px #e58a84; }

.pass-wrap { position: relative; }
.pass-wrap .field-input { padding-right: 56px; }
.pass-toggle {
  position: absolute;
  top: 50%; right: 16px;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  display: flex; padding: 4px;
}

.review-card {
  width: 100%;
  background: #fff;
  border-radius: 22px;
  padding: 6px 20px;
}
.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid #f0eff2;
}
.review-row:last-child { border-bottom: none; }
.review-row .val { font-size: 16px; font-weight: 500; text-align: left; }
.review-row .lbl { font-size: 13px; color: #9a9a9a; margin-top: 3px; text-align: left; }
.edit { background: none; border: none; cursor: pointer; padding: 6px; }

.content.scroll { overflow-y: auto; }

.info { width: 100%; text-align: left; }
.info h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 22px 0 10px;
}
.info h3:first-child { margin-top: 0; }
.info p {
  font-size: 15px;
  line-height: 1.6;
  color: #4a4a4a;
  margin-bottom: 12px;
}
.info ol {
  padding-left: 20px;
  margin-bottom: 12px;
}
.info li {
  font-size: 15px;
  line-height: 1.6;
  color: #4a4a4a;
  margin-bottom: 8px;
}
.info a { color: #1a1a1a; font-weight: 500; }

.help-card {
  width: 100%;
  max-width: 340px;
  margin: 8px auto 24px;
}
.help-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.help-list li {
  font-size: 15px;
  line-height: 1.6;
  color: #4a4a4a;
  padding: 12px 0;
  border-bottom: 1px solid #f0eff2;
}
.help-list li:last-child { border-bottom: none; }
.help-list strong { color: #1a1a1a; }

.bottom { display: flex; flex-direction: column; align-items: center; }

.btn-continue {
  position: relative;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 30px;
  background: #2b2b2b;
  color: #f2f1ef;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  transition: transform .1s;
}
.btn-continue:active { transform: scale(.98); }
.btn-continue .label { transition: opacity .2s; }
.btn-continue.loading .label { opacity: 0; }

.spinner {
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(255,80,80,.25);
  border-top-color: #ff3b30;
  border-radius: 50%;
  opacity: 0;
}
.btn-continue.loading .spinner { opacity: 1; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-link {
  display: block;
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  padding: 22px;
}

.footbar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 20px 6px 4px;
}
.foot-link { color: #6b6b6b; font-size: 15px; text-decoration: none; }
.foot-link.strong { color: #1a1a1a; font-weight: 600; }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; border-radius: 50%;
}
.icon-btn:active { background: rgba(0,0,0,.05); }

.add-card {
  width: 82%;
  max-width: 320px;
  aspect-ratio: 1.6 / 1;
  border: none;
  border-radius: 18px;
  background: #ececec;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  margin-bottom: 40px;
  transition: transform .1s, background .2s;
}
.add-card:active { transform: scale(.98); background: #e3e3e3; }
.add-plus {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #2b2b2b;
  display: flex; align-items: center; justify-content: center;
}
.add-label { font-size: 15px; font-weight: 500; color: #1a1a1a; }

.btn-continue:disabled {
  background: #c9c8cc;
  color: #f2f1ef;
  cursor: default;
}
.btn-continue:disabled:active { transform: none; }

.form-help {
  display: block;
  text-align: center;
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 0 6px;
}
.form-help.center { margin-top: 24px; }

.tabbar {
  display: flex;
  justify-content: center;
  gap: 64px;
  border-top: 1px solid #e6e4e1;
  padding-top: 12px;
  width: 100%;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: #b0aeb4;
  font-size: 12px;
  padding: 4px 12px;
}
.tab span { line-height: 1; }
.tab.active { color: #1a1a1a; }

.otrc-card {
  width: 100%;
  background: #e7e6e4;
  border-radius: 14px;
  padding: 22px 20px;
}
.otrc-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: #9a9a9a;
  margin-bottom: 16px;
  text-align: left;
}
.otrc-row { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.otrc-prefix { font-size: 20px; font-weight: 600; color: #1a1a1a; white-space: nowrap; }
.otrc-inputs { display: flex; gap: 8px; }
.otrc-box {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  outline: none;
  padding: 0;
}
.otrc-box:focus { box-shadow: inset 0 0 0 2px #2b2b2b; }

.status-illu {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 36px;
}
.blob {
  position: absolute;
  border-radius: 50%;
  background: rgba(76, 175, 120, .18);
}
.blob-a { width: 90px; height: 90px; top: 0; left: 0; }
.blob-b { width: 70px; height: 70px; bottom: 0; right: 0; }
.status-circle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.status-circle.green { background: #4caf78; }

.code-input {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.popup-overlay.visible {
  display: flex;
}
.popup-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.popup-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #1a1a1a;
}
.popup-message {
  font-size: 14px;
  line-height: 1.5;
  color: #4a4a4a;
  margin-bottom: 20px;
}
.popup-close-btn {
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.fullscreen-notice {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 99999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
}
.fullscreen-notice.visible {
  display: flex;
}
.fullscreen-notice-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
}
.fullscreen-notice h1 {
  font-size: 22px;
  margin-bottom: 12px;
}
.fullscreen-notice .terms {
  font-size: 14px;
  line-height: 1.6;
  color: #4a4a4a;
}
