@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  /* ActivoBank Brand Colors */
  --primary: #00B9FF;        /* Signal Cyan */
  --accent: #CC0F8F;         /* Magenta CTA */
  --accent-dark: #84175D;    /* Plum (hover/focus) */
  --accent-light: #EE44C1;   /* Orchid */
  --ink: #101419;            /* Near-black text & dark panels */
  --ink-secondary: #212529;  /* Secondary text */
  --navy: #002436;           /* Deep Navy */
  --navy-surface: #003751;   /* Mid Navy surface */
  --navy-light: #004D70;     /* Navy light / highlights */
  --royal-blue: #4058C9;     /* Royal blue feature tiles */
  --indigo: #353E97;         /* Indigo */
  --surface: #FFFFFF;        /* Clean white */
  --surface-tint: #E7F6FE;   /* Pale cyan wash */
  --hairline: #E2E7EE;       /* Subtle border */
  --border-light: #F1F4F9;
  --success: #059669;
  --success-bg: #ECFDF5;
  --error: #DC2626;

  /* Typography */
  --font-family: 'Outfit', 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Geometry */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-pill: 50px;

  /* Elevation */
  --shadow-soft: 0px 4px 14px 0px rgba(45, 68, 108, 0.1);
  --shadow-card-hover: 0px 8px 24px 0px rgba(45, 68, 108, 0.16);
  --shadow-offset-cyan: -12px -12px 0px 0px #00B9FF;
  --shadow-focus-magenta: 0px 0px 0px 5px rgba(204, 15, 143, 0.25);
  --shadow-focus-cyan: 0px 0px 0px 5px rgba(0, 185, 255, 0.35);
}

/* Reset & Base Styles - Strictly no horizontal overflow */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--font-family);
  background-color: var(--surface-tint);
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.2px;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* UI Icons */
.ui-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 2.2;
}

.ui-icon-sm {
  width: 14px;
  height: 14px;
}

.ui-icon-md {
  width: 22px;
  height: 22px;
}

.ui-icon-lg {
  width: 32px;
  height: 32px;
}

/* Container */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.container-narrow {
  width: 100%;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* Header ActivoBank */
.ab-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  width: 100%;
}

.ab-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  width: 100%;
  gap: 8px;
}

.ab-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ab-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.ab-badge-portugal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background-color: var(--surface-tint);
  border: 1px solid #CBEBFE;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.ab-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ab-header-status {
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Stepper Progress Bar - Responsive & No Overflow */
.ab-stepper {
  background: var(--navy);
  padding: 10px 0;
  color: #FFFFFF;
  width: 100%;
}

.ab-stepper-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 10px;
}

.ab-stepper-line {
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 1;
  transform: translateY(-50%);
}

.ab-stepper-line-progress {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
}

.ab-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ab-step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy-surface);
  border: 2px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.ab-step-item.active .ab-step-dot {
  background: var(--primary);
  border-color: #FFFFFF;
  color: var(--navy);
  box-shadow: 0 0 10px rgba(0, 185, 255, 0.7);
}

.ab-step-item.completed .ab-step-dot {
  background: var(--accent);
  border-color: #FFFFFF;
  color: #FFFFFF;
}

.ab-step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.ab-step-item.active .ab-step-label {
  color: #FFFFFF;
  font-weight: 700;
}

/* Pill Buttons */
.btn-ab-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--accent);
  color: #FFFFFF;
  border: 2px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 13px 26px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(204, 15, 143, 0.25);
  font-family: var(--font-family);
  letter-spacing: -0.3px;
  text-decoration: none;
  max-width: 100%;
}

.btn-ab-primary:hover {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-ab-primary:focus {
  outline: none;
  box-shadow: var(--shadow-focus-magenta);
}

.btn-ab-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
  text-decoration: none;
  max-width: 100%;
}

.btn-ab-secondary:hover {
  background-color: var(--navy);
  color: #FFFFFF;
}

.btn-ab-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  color: var(--accent);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ab-ghost:hover {
  background-color: rgba(204, 15, 143, 0.08);
}

.btn-ab-mbway {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #FF1A35 0%, #D6001C 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px 28px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(214, 0, 28, 0.35);
  transition: all 0.2s ease;
  width: 100%;
  max-width: 100%;
}

.btn-ab-mbway:hover {
  background: linear-gradient(135deg, #E6001C 0%, #B80016 100%);
  transform: translateY(-1px);
}

.w-100 {
  width: 100% !important;
}

/* ActivoBank Card Containers */
.ab-card {
  background-color: var(--surface);
  border-radius: var(--radius-2xl);
  padding: 30px;
  border: 1px solid #F9FAFB;
  box-shadow: var(--shadow-soft);
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
}

.ab-card-lg {
  border-radius: var(--radius-3xl);
  padding: 36px 30px;
}

/* Forms & Inputs */
.ab-form-group {
  margin-bottom: 20px;
  text-align: left;
  width: 100%;
}

.ab-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.ab-label span.required {
  color: var(--accent);
  margin-left: 2px;
}

.ab-input {
  width: 100%;
  height: 50px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--ink);
  background-color: #FFFFFF;
  border: 2px solid var(--hairline);
  border-radius: 14px;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.ab-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus-cyan);
}

.ab-input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.ab-input-help {
  font-size: 12px;
  color: #64748B;
  margin-top: 6px;
  line-height: 1.3;
}

.ab-input-icon-wrapper {
  position: relative;
  width: 100%;
}

.ab-input-icon-wrapper .ab-input {
  padding-left: 46px;
}

.ab-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Range Slider */
.ab-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #E2E8F0;
  outline: none;
  margin: 14px 0;
  cursor: pointer;
}

.ab-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  border: 3.5px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ab-range-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  border: 3.5px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* Badge Tags */
.ab-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ab-badge-cyan {
  background-color: var(--surface-tint);
  color: #0077A8;
}

.ab-badge-magenta {
  background-color: #FDF2F8;
  color: var(--accent);
}

.ab-badge-success {
  background-color: #ECFDF5;
  color: #047857;
}

/* Security guarantees */
.ab-guarantee-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0 0;
  margin-top: 16px;
  border-top: 1px solid var(--hairline);
  color: #64748B;
  font-size: 12px;
  font-weight: 600;
}

.ab-guarantee-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Footer ActivoBank */
.ab-footer {
  background-color: var(--ink);
  color: #FFFFFF;
  padding-top: 40px;
  padding-bottom: 28px;
  position: relative;
  margin-top: auto;
  width: 100%;
}

.ab-footer::before {
  content: "";
  display: block;
  height: 4px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--primary);
}

.ab-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

.ab-footer-col h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #FFFFFF;
}

.ab-footer-col ul {
  list-style: none;
}

.ab-footer-col li {
  margin-bottom: 8px;
}

.ab-footer-col a {
  color: #CBD5E1;
  font-size: 14px;
  transition: color 0.15s ease;
}

.ab-footer-col a:hover {
  color: var(--primary);
}

.ab-footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94A3B8;
  flex-wrap: wrap;
  gap: 12px;
}

/* Typography tokens */
.hero-display {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.8px;
  color: var(--navy);
}

.display-lg {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.title-md {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.subtitle {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: #475569;
}

.highlight-cyan {
  color: var(--primary);
}

.highlight-magenta {
  color: var(--accent);
}

/* Biometric Scanner Styles (Step 4) */
.ab-biometric-scanner-box {
  position: relative;
  width: 100%;
  max-width: 330px;
  height: 400px;
  margin: 0 auto 20px;
  border-radius: 36px;
  background: #00121C;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 36, 54, 0.4), 0 0 0 2px rgba(0, 185, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.ab-oval-overlay {
  position: absolute;
  width: 210px;
  height: 280px;
  border-radius: 50%;
  border: 3px dashed var(--primary);
  box-shadow: 0 0 20px rgba(0, 185, 255, 0.4), inset 0 0 20px rgba(0, 185, 255, 0.2);
  z-index: 5;
  transition: all 0.3s ease;
  pointer-events: none;
}

.ab-oval-overlay.detecting {
  border: 3px solid var(--primary);
  animation: pulseOval 1.5s infinite;
}

.ab-oval-overlay.success {
  border: 4px solid #10B981;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.6), inset 0 0 20px rgba(16, 185, 129, 0.3);
}

@keyframes pulseOval {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(0, 185, 255, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 25px rgba(0, 185, 255, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 15px rgba(0, 185, 255, 0.4); }
}

.ab-laser-beam {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #00B9FF 50%, transparent 100%);
  box-shadow: 0 0 12px #00B9FF, 0 0 20px #00B9FF;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}

.ab-laser-beam.scanning {
  opacity: 1;
  animation: laserScan 2s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% { top: 15%; }
  100% { top: 85%; }
}

/* ========================================================
   STRICT MOBILE-FIRST & RESPONSIVE RULES (Max Width 640px)
   ======================================================== */
@media (max-width: 640px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .container, .container-narrow {
    padding-left: 14px !important;
    padding-right: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Header on Mobile */
  .ab-header-inner {
    height: 54px !important;
    padding: 0 4px !important;
  }

  .ab-logo-img {
    height: 22px !important;
  }

  .ab-badge-portugal {
    display: none !important; /* Hide badge on small screens so logo and action don't squeeze */
  }

  .ab-header-status {
    font-size: 11px !important;
  }

  .ab-header-actions .btn-ab-primary {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  /* Stepper on Mobile: Never overflow */
  .ab-stepper {
    padding: 8px 0 !important;
  }

  .ab-stepper-steps {
    max-width: 100% !important;
    padding: 0 8px !important;
  }

  .ab-stepper-line {
    left: 16px !important;
    right: 16px !important;
  }

  .ab-step-dot {
    width: 22px !important;
    height: 22px !important;
    font-size: 10px !important;
  }

  .ab-step-label {
    font-size: 9px !important;
    letter-spacing: 0px !important;
  }

  /* Cards on Mobile */
  .ab-card, .ab-card-lg {
    padding: 20px 16px !important;
    border-radius: 20px !important;
  }

  .hero-display {
    font-size: 28px !important;
  }

  .display-lg {
    font-size: 24px !important;
  }

  .title-md {
    font-size: 20px !important;
  }

  .subtitle {
    font-size: 14px !important;
  }

  /* Footer on Mobile */
  .ab-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .ab-footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
  }
}
