:root {
  --red: #f53b3b;
  --bg-light: #f8f3f7;
  --text-main: #101010;
  --text-muted: #a0a0a5;
  --border-soft: #e1e1e6;
  --white: #ffffff;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.08);
}

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

html {
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: hidden;
  height: 100%;
  width: 100%;
  position: fixed;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: hidden;
  position: fixed;
  font-family: "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: var(--bg-light);
  color: var(--text-main);
  touch-action: manipulation;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

/* Splash Screen */

#splash-screen {
  position: fixed;
  inset: 0;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.splash-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  animation: fadeInScale 0.9s ease-out forwards;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hidden {
  display: none;
}

/* Login Screen Layout */

.login-container {
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

.top-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
}

.top-right-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--white);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.lang-switch-btn:hover {
  background: #f5f5f7;
  border-color: #d1d1d6;
}

.status-pill {
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: #000;
  opacity: 0.06;
}

.bank-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1.4px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bank-pill {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.4px solid rgba(0, 0, 0, 0.45);
  border-top-width: 3px;
}

.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-top: 20px;
}

.login-title {
  font-size: 1.4rem;
  margin: 0 0 32px;
  font-weight: 600;
  line-height: 1.25;
}

.input-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
}

.country-code {
  font-weight: 500;
  margin-right: 10px;
  white-space: nowrap;
}

.input-wrapper input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
}

.input-wrapper input::placeholder {
  color: #c2c2c7;
}

.input-wrapper input.error {
  border: none;
}

.input-wrapper.error {
  border-color: #ff4d4f;
}

.helper-text {
  text-align: center;
  margin: 40px 0 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: none;
  outline: none;
  border-radius: 6px;
  padding: 16px;
  background: var(--red);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(245, 59, 59, 0.4);
}

.primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 10px 22px rgba(245, 59, 59, 0.3);
}

.btn-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1.5px solid #ffe5e5;
  position: relative;
}

.btn-icon::before,
.btn-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  border: 1.5px solid #ffe5e5;
}

.btn-icon::after {
  inset: 7px;
}

.terms-text {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.terms-text a {
  color: #0086ff;
  text-decoration: none;
}

.terms-text a:hover {
  text-decoration: underline;
}

/* Card Identification Screen */

.card-container {
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 20px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.back-btn {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  padding: 0 4px 4px 0;
  cursor: pointer;
}

.card-header-title {
  font-weight: 600;
  font-size: 1rem;
}

.card-bank-pill {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #ffe5e6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-bank-inner {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #f53b3b;
  border-top-width: 3px;
}

.card-main {
  padding-top: 8px;
}

.card-intro-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 600;
}

.card-intro-sub {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 0;
}

.card-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}

.card-field-icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: #ffe5e6;
  margin-right: 10px;
  position: relative;
}

.card-field-icon-card::before {
  content: "";
  position: absolute;
  inset: 7px 6px;
  border-radius: 5px;
  border: 2px solid #f53b3b;
}

.card-field-icon-card::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 9px;
  height: 3px;
  background: #f53b3b;
  border-radius: 999px;
}

.card-field-icon-lock::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 15px;
  width: 14px;
  height: 10px;
  border-radius: 4px;
  border: 2px solid #f53b3b;
}

.card-field-icon-lock::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 7px;
  width: 10px;
  height: 8px;
  border-radius: 6px 6px 0 0;
  border: 2px solid #f53b3b;
  border-bottom: none;
}

.card-field-input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 1.05rem;
  font-weight: 500;
}

.card-field-action {
  font-size: 1.1rem;
  color: #c7c7cc;
}

.card-field-exclamation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.card-continue-btn {
  margin-top: 20px;
  margin-bottom: 16px;
}

.no-card-link {
  display: inline-block;
  margin-top: 0;
  color: #e00000;
  font-size: 0.88rem;
  text-decoration: underline;
}

.bottom-continue-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.bottom-continue-btn:disabled {
  background: rgba(255, 255, 255, 0.9);
  color: #9b9b9f;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.04);
  cursor: default;
}

.bottom-continue-btn:not(:disabled) {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 14px 32px rgba(245, 59, 59, 0.4);
  cursor: pointer;
}

.bottom-continue-btn:not(:disabled):active {
  box-shadow: 0 10px 22px rgba(245, 59, 59, 0.3);
}

/* OTP Screen */

.otp-container {
  position: relative;
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 20px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

.otp-header {
  height: 32px;
  display: flex;
  align-items: center;
}

.otp-main {
  margin-top: 16px;
}

.otp-title {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 600;
}

.otp-sub {
  margin: 0 0 40px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.otp-inputs {
  display: flex;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  margin: 0;
}

.otp-input {
  width: 46px;
  border: none;
  border-bottom: 2px solid #e1e1e6;
  background: transparent;
  text-align: center;
  font-size: 1.8rem;
  padding-bottom: 6px;
}

.otp-input:focus {
  outline: none;
  border-bottom-color: var(--red);
}

.otp-inputs .otp-input:first-child {
  border-bottom-color: var(--red);
}

.otp-resend {
  margin-top: 32px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.otp-resend span {
  color: #e00000;
  font-weight: 500;
}

.otp-continue-btn {
  margin-top: 28px;
}

.otp-continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.otp-error-msg {
  margin: 16px 0 0;
  font-size: 0.95rem;
  color: #c62828;
  font-weight: 500;
  text-align: center;
}

/* Red loader overlay on OTP screen */
.otp-loader {
  position: absolute;
  inset: 0;
  background: rgba(245, 59, 59, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.otp-loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: otp-spin 0.9s linear infinite;
}

@keyframes otp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Global loader (every screen transition) */
.global-loader {
  position: fixed;
  inset: 0;
  background: rgba(245, 59, 59, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.global-loader-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: otp-spin 0.9s linear infinite;
}

/* Account Security Screen */

.security-container {
  min-height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 20px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
}

.security-main {
  flex: 1;
  margin-top: 8px;
}

.security-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}

.security-sub {
  margin: 0 0 28px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.security-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}

.security-field {
  margin-top: 0;
}

.security-field .card-field-input {
  font-size: 1rem;
}

.security-continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* FIN info bottom sheet popup */
.fin-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  transition: opacity 0.25s ease;
}

.fin-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  z-index: 201;
  padding: 12px 20px 28px;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.fin-sheet.fin-sheet-visible {
  transform: translateY(0);
}

.fin-sheet-handle {
  width: 36px;
  height: 4px;
  background: #d1d1d6;
  border-radius: 2px;
  margin: 0 auto 16px;
}

.fin-sheet-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #8e8e93;
  cursor: pointer;
  padding: 0;
}

.fin-sheet-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.fin-sheet-intro {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.fin-sheet-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fin-sheet-card-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fin-sheet-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.fin-sheet-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  display: block;
}

#fin-info-btn {
  cursor: pointer;
}

/* Center layout on larger screens */

@media (min-width: 768px) {
  .login-container,
  .card-container,
  .otp-container,
  .security-container {
    max-width: 420px;
    margin: 0 auto;
  }
}

