*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #8fb19d;
}

button,
input {
  font: inherit;
  border: none;
  outline: none;
  background: none;
}

.page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: #8fb19d;
}

.page__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 0;
}

.page__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: env(safe-area-inset-top, 0) 16px 0;
}

.page__close {
  position: absolute;
  left: 16px;
  top: calc(env(safe-area-inset-top, 0) + 10px);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.page__close::before,
.page__close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background: #ffffff;
  border-radius: 1px;
}

.page__close::before {
  transform: rotate(45deg);
}

.page__close::after {
  transform: rotate(-45deg);
}

.page__title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  line-height: 44px;
}

.page__body {
  position: relative;
  z-index: 1;
  padding: 180px 20px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
}

.card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card__referrer {
  background: #008751;
  padding: 14px 16px;
  text-align: center;
}

.card__referrer-text {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  line-height: 20px;
  word-break: break-all;
}

.card__form {
  padding: 8px 20px 24px;
}

.field {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid #efeff1;
}

.field__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-right: 12px;
}

.field__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  font-size: 14px;
  color: #333333;
}

.field__input::placeholder {
  color: #bac8c2;
}

.field__action {
  flex-shrink: 0;
  margin-left: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #008751;
  cursor: pointer;
  white-space: nowrap;
}

.field__action.is-disabled {
  color: #bac8c2;
  cursor: not-allowed;
}

.field__eye {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  cursor: pointer;
  position: relative;
  color: #999999;
}

.field__eye::before {
  content: '';
  position: absolute;
  inset: 4px 2px 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.field__eye::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: currentColor;
  border-radius: 50%;
}

.field__eye.is-visible::before {
  inset: 6px 2px;
  border-radius: 2px;
  transform: rotate(-35deg);
}

.field__eye.is-visible::after {
  display: none;
}

.card__submit {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 24px;
  border-radius: 24px;
  background: #008751;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
}

.card__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.card__download {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #666666;
  line-height: 20px;
}

.card__download-link {
  color: #008751;
  font-weight: 500;
  cursor: pointer;
}

.agreement {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  padding: 0 4px;
}

.agreement__check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}

.agreement__text {
  flex: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 18px;
}

.agreement__link {
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%);
  max-width: calc(100% - 48px);
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
}

@media (min-width: 480px) {
  .page__body {
    max-width: 420px;
    margin: 0 auto;
  }
}
