@font-face {
  font-family: "App Textos";
  src: url("../fonts/ApplicationTextos-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "App Textos";
  src: url("../fonts/ApplicationTextos-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "App Títulos";
  src: url("../fonts/ApplicationTitulos-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "App Títulos";
  src: url("../fonts/ApplicationTitulos-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-text: "App Textos", "Segoe UI", Arial, sans-serif;
  --font-title: "App Títulos", "App Textos", "Segoe UI", Arial, sans-serif;
  --bg-app: #f2f0ef;
  --dark-green: #083f3d;
  --dark-green-2: #0d4a45;
  --green-line: #92b9af;
  --text: #1d1d1d;
  --muted: #7a7a7a;
  --placeholder: #9c9b98;
  --field: #f8f7f6;
  --field-border: #d9d7d5;
  --button-yellow: #f4dd4a;
  --button-yellow-deep: #e8d24a;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  background: var(--bg-app);
  font-family: var(--font-text);
  color: var(--text);
  overflow: hidden;
}

.page,
.phone {
  overflow-x: hidden;
}

.phone {
  position: relative;
  width: 100%;
  max-width: 530px;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header-bar {
  background: var(--dark-green);
  color: #fff;
  padding: calc(18px + env(safe-area-inset-top)) 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.arrow {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
}

.arrow svg {
  width: 20px;
  height: 20px;
  stroke: #f9f8f7;
  stroke-width: 2.5;
  fill: none;
}

.page-title {
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-line {
  display: block;
  width: 2px;
  height: 34px;
  background: #fdf936;
  transform: rotate(30deg);
}

.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
}

.brand-logo svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #fdf936;
}

.content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 16px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.hero {
  padding-top: 4px;
}

h1 {
  font-family: var(--font-title);
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #222121;
}

.lead {
  margin: 10px 0 0;
  color: #1d1d1d;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.selector {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.option {
  flex: 2 1 0;
  box-sizing: border-box;
  min-width: 0;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1.5px solid var(--field-border);
  background: #fff;
  color: #4a4745;
  font-family: var(--font-text);
  font-size: 15px;
  letter-spacing: -0.01em;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.option-agencia {
  flex-grow: 3;
}

.option.is-active {
  background: rgba(93, 130, 123, 0.04);
  border-color: rgba(75, 136, 124, 0.85);
  color: #0d4d46;
}

.field-group {
  margin-top: 20px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.field {
  font-family: var(--font-text);
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--field-border);
  background: rgba(255, 255, 255, 0.18);
  padding: 0 14px;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
  outline: none;
}

.field::placeholder {
  color: var(--placeholder);
}

.hint {
  margin-top: 6px;
  display: block;
  color: #6f6b68;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.4;
}

.hint.error {
  color: #b42318;
  font-weight: 600;
}

.field.error {
  border-color: #b42318;
  background: rgba(180, 35, 24, 0.04);
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.12);
}

.field-block + .field-block {
  margin-top: 14px;
}

[hidden] {
  display: none !important;
}

.agencia-conta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.agencia-conta .field-block + .field-block {
  margin-top: 0;
}

.agencia-conta + .field-block {
  margin-top: 16px;
}

.secure-box {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #e4ebf2;
}

.secure-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--dark-green);
  background: #fff;
}

.secure-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--dark-green);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.secure-text strong {
  display: block;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #1d1d1d;
}

.secure-text p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #3a3a3a;
}

.bottom-cta {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 16px;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg-app);
}

.button {
  font-family: var(--font-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: #fdf936;
  color: #0b2f2d;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 600;
  box-shadow: none;
}

.page {
  min-height: 100vh;
}

.desktop-panel {
  display: none;
}

@media (pointer: coarse), (max-width: 767px) {
  .secure-numeric-keypad {
    display: none !important;
  }
}

@media (min-width: 900px) {
  body {
    background: #e9e7e5;
  }

  .page {
    display: grid;
    grid-template-columns: minmax(420px, 480px) 1fr;
    height: 100vh;
    overflow: hidden;
  }

  .phone {
    max-width: none;
    height: 100vh;
    overflow-y: auto;
    margin: 0;
    background: var(--bg-app);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
  }

  .phone .header-bar {
    padding-left: 28px;
    padding-right: 28px;
  }

  .phone .content {
    padding-left: 28px;
    padding-right: 28px;
  }

  .phone .bottom-cta {
    padding-left: 28px;
    padding-right: 28px;
  }

  .page {
    grid-template-columns: 480px min(calc(100vh * 960 / 972), calc(100vw - 480px));
    justify-content: center;
  }

  .desktop-panel {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    overflow: hidden;
    background: var(--dark-green);
  }

  .desktop-panel-img {
    display: block;
    flex: none;
    height: 100vh;
    width: 100%;
    object-fit: cover;
  }
}

@media (max-width: 420px) {
  .option {
    padding: 0;
    font-size: 15px;
  }

  .option.is-active {
    font-size: 15px;
  }
}

/* Tela de carregamento inicial */
.splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(8, 63, 61, 0.88);
  color: #fff;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fdf936;
  border-radius: 50%;
  animation: splash-spin 0.9s linear infinite;
}

.splash-text {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 0.02em;
}

.secure-numeric-keypad {
  position: fixed;
  z-index: 1200;
  width: min(76vw, 300px);
  background: #f5f6f7;
  border: 1px solid #d7dfe3;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 32px rgba(17, 30, 35, 0.18), 0 4px 10px rgba(17, 30, 35, 0.08);
  display: none;
  font-family: "Segoe UI", "Tahoma", sans-serif;
}

.secure-numeric-keypad.is-visible {
  display: block;
}

.secure-numeric-keypad__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, #0f8a75 0%, #0c6d60 100%);
  color: #fff;
  padding: 8px 10px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.secure-numeric-keypad__drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  user-select: none;
  opacity: 0.9;
  font-size: 14px;
  letter-spacing: 0.18em;
}

.secure-numeric-keypad__title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
}

.secure-numeric-keypad__close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.secure-numeric-keypad__display {
  margin: 12px 12px 8px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  border: 1px solid #dfe7eb;
  border-radius: 8px;
  background: #f9fbfc;
  color: #1d2d39;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.secure-numeric-keypad__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.secure-numeric-keypad__button,
.secure-numeric-keypad__confirm {
  height: 42px;
  border: 1px solid #cdd6da;
  border-bottom-color: #b2bec6;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #edf1f4 100%);
  color: #1e2d38;
  font-family: "Segoe UI", "Tahoma", sans-serif;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 0 rgba(18, 55, 60, 0.06);
}

.secure-numeric-keypad__button:active,
.secure-numeric-keypad__confirm:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 0 rgba(18, 55, 60, 0.05);
}

.secure-numeric-keypad__button--clear,
.secure-numeric-keypad__button--backspace {
  background: linear-gradient(180deg, #edf3f8 0%, #dde7ee 100%);
}

.secure-numeric-keypad__actions {
  padding: 0 12px 12px;
}

.secure-numeric-keypad__confirm {
  width: 100%;
  height: 38px;
  background: linear-gradient(180deg, #1aa187 0%, #13886f 100%);
  border-color: #0f7a66;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.secure-numeric-keypad__confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.verification-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(8, 18, 17, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.verification-modal-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.verification-modal {
  width: 100%;
  max-width: min(95%, 530px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 22px 18px 50px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.18);
  margin: 0 auto;
  transform: none;
}

@media (min-width: 900px) {
  .verification-modal-backdrop {
    position: absolute;
    inset: 0;
    align-items: flex-end;
    justify-content: center;
    background: rgba(8, 18, 17, 0.18);
  }

  .verification-modal {
    width: 100%;
    max-width: min(95%, 530px);
    border-radius: 20px 20px 0 0;
    margin: 0 auto;
    transform: none;
  }
}

.verification-modal__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 1.2;
  color: #1d1d1d;
}

.verification-modal__text {
  margin: 10px 0 0;
  color: #4d4a49;
  font-size: 14px;
  line-height: 1.5;
}

.verification-modal__helper {
  min-height: 18px;
  margin-top: 10px;
}

.verification-modal__hint,
.verification-modal__error {
  display: block;
  font-size: 12px;
  line-height: 1.4;
}

.verification-modal__hint {
  color: #6f6b68;
}

.verification-modal__error {
  color: #b42318;
  font-weight: 600;
}

.verification-modal__error:empty {
  display: none;
}

.verification-modal__input {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  border: 1.5px solid var(--field-border);
  border-radius: 12px;
  background: #f8f7f6;
  padding: 0 14px;
  font-size: 18px;
  letter-spacing: 0.2em;
  text-align: center;
  color: var(--text);
  outline: none;
}

.verification-modal__input.error {
  border-color: #b42318;
  background: rgba(180, 35, 24, 0.04);
  box-shadow: 0 0 0 1px rgba(180, 35, 24, 0.12);
}

.verification-modal__actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.verification-modal__button {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: #fdf936;
  color: #0b2f2d;
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

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

@media (orientation: landscape) and (max-width: 900px) {
  body {
    overflow: hidden;
  }

  body::before {
    content: 'Gire o celular para retrato';
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #083f3d;
    color: #f3f3f3;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    padding: 24px;
    z-index: 9999;
  }
}
