*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: #1a1a1a;
  background: #fff;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0) max(16px, env(safe-area-inset-right, 0)) max(16px, env(safe-area-inset-bottom, 0)) max(16px, env(safe-area-inset-left, 0));
}

/* Header / Logo */
.header {
  padding: 32px 0 24px;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1a1a1a;
}

.logo-text {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-dot {
  color: #e8537f;
}

/* Main content */
.main {
  flex: 1;
  padding: 8px 0 40px;
}

.method-label {
  font-size: 15px;
  color: #0066cc;
  margin-bottom: 12px;
}

.title {
  font-size: 36px;
  font-weight: 700;
  color: #002d5e;
  line-height: 1.2;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 16px;
  color: #555;
  margin-bottom: 32px;
}

/* Form fields */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-box {
  position: relative;
  background: #eef4fa;
  border: 1px solid #d4e4f4;
  border-radius: 10px;
  padding: 22px 16px 14px;
}

.field-label {
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 13px;
  color: #0066cc;
  font-weight: 500;
  pointer-events: none;
}

.field-input,
.field-select {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: #333;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  min-height: 28px;
}

.field-input[type="tel"],
.field-input[inputmode="numeric"] {
  font-size: 16px;
}

.field-input::placeholder {
  color: #999;
}

.field-select {
  padding-right: 28px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.field-select option {
  color: #1a1a1a;
  background: #fff;
}

.field-input:focus,
.field-select:focus {
  outline: none;
}

.field-box:focus-within {
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.12);
}

.btn-continue {
  width: 100%;
  margin-top: 8px;
  padding: 16px 24px;
  min-height: 52px;
  background: #0066cc;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-continue:hover {
  background: #0052a3;
}

.btn-continue:active {
  background: #004080;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 32px;
  margin-top: auto;
}

.footer-link {
  font-size: 15px;
  color: #0066cc;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-sep {
  color: #0066cc;
  font-size: 14px;
}

@media (max-width: 480px) {
  .header {
    padding: 24px 0 20px;
  }

  .logo-text {
    font-size: 24px;
  }

  .logo-dots {
    width: 32px;
    height: 32px;
  }

  .title {
    font-size: 28px;
  }

  .subtitle {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .field-box {
    padding: 20px 14px 12px;
  }

  .footer {
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  }

  .footer-right {
    flex-wrap: wrap;
  }

  .approve-content .title {
    font-size: 24px;
  }

  .approve-text {
    font-size: 15px;
    padding: 0 4px;
  }
}

@media (min-width: 561px) {
  .page {
    padding-left: 24px;
    padding-right: 24px;
  }

  .title {
    font-size: 40px;
  }
}

/* Loading */
.loading-content {
  text-align: center;
  padding-top: 48px;
}

.loading-content .title {
  font-size: 28px;
  margin-bottom: 12px;
}

.loading-content .subtitle {
  margin-bottom: 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #d4e4f4;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 28px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Card expiry */
.expiry-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.expiry-input {
  flex: 1;
}

.expiry-sep {
  font-size: 18px;
  color: #555;
}

.field-box .expiry-row .field-input {
  padding-top: 0;
}

/* Approve */
.approve-content {
  text-align: center;
  padding-top: 32px;
}

.approve-content .title {
  font-size: 28px;
  margin-bottom: 20px;
}

.approve-text {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
  max-width: 320px;
  margin: 0 auto 40px;
}

.approve-code {
  color: #002d5e;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.approve-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.approve-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: approve-bounce 1.2s ease-in-out infinite;
}

.approve-dot--navy {
  background: #002d5e;
}

.approve-dot--orange {
  background: #e8751a;
  animation-delay: 0.2s;
}

.approve-dot--teal {
  background: #2eb8c4;
  animation-delay: 0.4s;
}

@keyframes approve-bounce {
  0%, 80%, 100% {
    transform: scale(0.85);
    opacity: 0.6;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}
