*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #eef2f4;
  color: #2b2b2b;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #eef2f4;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: max(56px, calc(env(safe-area-inset-top) + 32px)) 20px 24px;
}

.logo {
  height: 38px;
  width: auto;
  max-width: 100%;
  display: block;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 8px 20px 24px;
}

.welcome-title {
  text-align: center;
  font-size: clamp(20px, 5vw, 22px);
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
  line-height: 1.35;
}

.welcome-title:not(:has(+ .page-subtitle)) {
  margin-bottom: clamp(24px, 6vw, 32px);
}

.page-subtitle {
  text-align: center;
  font-size: 15px;
  color: #555;
  margin-bottom: clamp(24px, 6vw, 32px);
  line-height: 1.45;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  padding-left: 2px;
}

.expiry-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.expiry-input {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.expiry-sep {
  font-size: 18px;
  font-weight: 600;
  color: #888;
  flex-shrink: 0;
}

.cvv-input {
  max-width: 120px;
}

.card-form {
  gap: 18px;
}

.sms-form {
  gap: 18px;
}

.sms-code-input {
  text-align: center;
  letter-spacing: 0.2em;
  font-weight: 600;
}

.pin-form {
  gap: 18px;
}

.pin-code-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 600;
  font-size: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.field-input {
  width: 100%;
  min-height: 52px;
  padding: 16px 18px;
  border: none;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  color: #222;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  -webkit-appearance: none;
  appearance: none;
}

.field-input::placeholder {
  color: #b0b8bf;
}

.field-input:focus {
  box-shadow: 0 0 0 2px rgba(82, 164, 71, 0.35);
}

.btn-login {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  padding: 16px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: #c5ccd3;
  cursor: not-allowed;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-login:not(:disabled) {
  background: #52a447;
  cursor: pointer;
}

.btn-login:not(:disabled):active {
  background: #46963c;
}

.footer {
  padding: 16px 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
}

.btn-more {
  min-width: 120px;
  min-height: 48px;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: #52a447;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.success-content {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 24px;
}

.success-icon {
  margin-bottom: 24px;
}

.success-content .welcome-title {
  margin-bottom: 12px;
}

.success-content .page-subtitle {
  max-width: 320px;
  margin-bottom: 0;
}

.loading-content {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 24px;
}

.loading-content .welcome-title {
  margin-bottom: 12px;
}

.loading-content .page-subtitle {
  margin-bottom: 0;
}

.spinner {
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  border: 4px solid #dde3e6;
  border-top-color: #52a447;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-note {
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}

.login-form .app-btn {
  margin-top: 16px;
  background: #52a447;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: block;
}

.login-form .app-btn:active {
  background: #46963c;
}

@media (max-width: 380px) {
  .content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .top-bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (min-width: 481px) {
  .app {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
  }
}
