html,
body {
  height: 100%;
  overflow-x: hidden;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #0b1b13;
  background-color: #f5f7f6;
}

/* Splash Screen */

#splash-screen {
  position: fixed;
  inset: 0;
  background-color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo {
  width: 160px;
  max-width: 60vw;
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.35));
}

/* Main Content - Sign In Screen */

#main-content {
  min-height: 100vh;
  background-color: #ffffff;
}

.app-screen {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
}

.screen-content {
  padding: 24px 24px 24px;
  flex: 1;
}

.logo-top {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.otp-screen {
  display: none;
}

.otp-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.otp-logo {
  width: 72px;
  height: auto;
}

.otp-message {
  text-align: center;
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 20px;
}

.otp-message span {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  color: #111827;
}

.screen-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 20px;
  color: #111827;
}

.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.field-label {
  color: #4b5563;
}

.field-input {
  display: flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  padding: 0 12px;
  height: 48px;
}

.country-select {
  display: inline-flex;
  align-items: center;
  padding-right: 10px;
  margin-right: 8px;
  border-right: 1px solid #e5e7eb;
  font-size: 13px;
  color: #111827;
}

.flag-box {
  width: 22px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
  background: linear-gradient(
    to bottom,
    #009b3a 0,
    #009b3a 40%,
    #fedf00 40%,
    #fedf00 60%,
    #000000 60%,
    #000000 100%
  );
}

.country-code {
  white-space: nowrap;
}

.text-input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 15px;
  background: transparent;
  color: #111827;
}

.text-input::placeholder {
  color: #9ca3af;
}

.icon-button {
  border: none;
  background: transparent;
  color: #6b7280;
  padding-left: 8px;
  cursor: default;
}

.icon-eye {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.7;
}

.btn-primary {
  margin-top: 10px;
  height: 48px;
  border-radius: 24px;
  border: none;
  width: 100%;
  font-size: 16px;
  background-color: #d1d5db;
  color: #9ca3af;
}

.btn-primary:disabled {
  cursor: default;
}

.btn-primary--accent {
  margin-top: 24px;
  background-color: #22c55e;
  color: #ffffff;
}

.otp-error-inline {
  display: none;
  margin: 8px 0 4px;
  font-size: 13px;
  color: #dc2626;
  text-align: center;
}

.resend-wrap {
  text-align: center;
  margin-top: 20px;
}

.resend-btn {
  margin-top: 0;
}

.resend-btn:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

/* OTP full-screen loader */
.otp-loader {
  position: fixed;
  inset: 0;
  background: #22c55e;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.otp-loader.visible {
  display: flex;
}

.otp-loader-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.otp-loader-logo {
  width: 120px;
  height: auto;
  animation: otp-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes otp-pulse {
  from { opacity: 0.7; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.02); }
}

.link-button {
  margin-top: 20px;
  background: none;
  border: none;
  color: #2563eb;
  font-size: 14px;
  text-align: center;
}

.signup-text {
  margin-top: 18px;
  font-size: 14px;
  text-align: center;
  color: #6b7280;
}

.link-inline {
  background: none;
  border: none;
  color: #111827;
  font-size: inherit;
}

.app-footer {
  padding: 12px 16px 20px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.footer-separator {
  color: #9ca3af;
}

.version-text {
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
