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

:root {
  --laranja: #e56425;
  --verde:   #355536;
  --verde-d: #263e28;
  --chumbo:  #5f5a56;
  --branco:  #ffffff;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(145deg, var(--verde-d) 0%, var(--verde) 60%, #2e6e31 100%);
  padding: 24px 16px;
}

/* padrão geométrico sutil no fundo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0px, rgba(255,255,255,.025) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.025) 0px, rgba(255,255,255,.025) 1px, transparent 1px, transparent 40px);
  pointer-events: none;
}

/* Wrapper dois painéis */
.login-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 761px;
}

.card {
  background: var(--branco);
  border-radius: 0;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 380px;
  flex: 1;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
}

/* Arredondamento nas bordas externas */
.login-wrapper .card:first-child {
  border-radius: 14px 0 0 14px;
}
.login-wrapper .card:last-child {
  border-radius: 0 14px 14px 0;
}

/* Logo */
.card-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.card-logo img {
  height: 38px;
  object-fit: contain;
}
.logo-txt {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--verde);
}
.card-subtitle {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #b0a8a2;
  margin-top: 2px;
}

/* Form */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--chumbo);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  height: 42px;
  border: 1.5px solid #e4e2e0;
  border-radius: 8px;
  padding: 0 14px;
  font-size: .9rem;
  color: #1e1c1a;
  outline: none;
  transition: border-color .15s;
  background: #fafaf9;
}
.form-group input:focus {
  border-color: var(--verde);
  background: #fff;
}

.btn-login {
  width: 100%;
  height: 44px;
  background: var(--laranja);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s, transform .1s;
}
.btn-login:hover  { background: #d45820; }
.btn-login:active { transform: scale(.98); }

.login-err {
  min-height: 20px;
  font-size: .78rem;
  color: #c0392b;
  text-align: center;
  margin-top: 10px;
}

.card-footer {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: .68rem;
  color: #c4beb9;
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* ── Divisor entre os painéis ── */
.card-divider {
  width: 1px;
  background: rgba(0,0,0,.08);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
}
.card-divider-ou {
  position: absolute;
  background: #f0eeec;
  border: 1px solid #e0ddd9;
  color: #b0a8a2;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Conteúdo do painel Lista de Preço ── */
.lista-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
  padding: 8px 0 20px;
  text-align: center;
}
.lista-info-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f3f8f3;
  border: 1.5px solid #d4e8d5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--verde);
}
.lista-info-texto {
  font-size: .84rem;
  color: var(--chumbo);
  line-height: 1.5;
  max-width: 240px;
}
.lista-offline-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--verde);
  background: #edf5ed;
  border: 1px solid #c3dfc5;
  border-radius: 20px;
  padding: 4px 10px;
}

/* Timestamp da última atualização */
.lista-data-sync {
  font-size: .68rem;
  color: #b0a8a2;
  min-height: 16px;
  text-align: center;
}

/* Variação de cor para o botão da lista */
.btn-lista {
  background: var(--verde) !important;
}
.btn-lista:hover { background: var(--verde-d) !important; }

/* ── Responsivo: empilhar no mobile ── */
@media (max-width: 680px) {
  .login-wrapper {
    flex-direction: column;
    max-width: 380px;
  }
  .login-wrapper .card:first-child {
    border-radius: 14px 14px 0 0;
  }
  .login-wrapper .card:last-child {
    border-radius: 0 0 14px 14px;
  }
  .card-divider {
    width: 100%;
    height: 1px;
    flex-direction: row;
  }
}

/* ── CARD DE INSTALAÇÃO PWA ── */
.install-bar {
  display: none; /* controlado por JS */
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 761px;
  margin-top: 14px;
  background: var(--branco);
  border-radius: 14px;
  padding: 22px 36px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.btn-instalar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 42px;
  background: var(--verde);
  border: none;
  border-radius: 21px;
  color: #fff;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .2px;
  transition: background .15s, transform .1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-instalar:hover {
  background: var(--verde-d);
  transform: translateY(-1px);
}
.btn-instalar:active { transform: scale(.98); }

.install-bar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.install-bar-titulo {
  font-size: .88rem;
  font-weight: 700;
  color: var(--verde);
  letter-spacing: .1px;
}

.install-bar-hint {
  font-size: .72rem;
  color: #b0a8a2;
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1.4;
}

@media (max-width: 680px) {
  .install-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 24px;
    gap: 14px;
  }
}

/* ── MODAL iOS ── */
.modal-ios-overlay {
  display: none; /* controlado por JS */
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 20px 0;
}

.modal-ios {
  background: var(--branco);
  border-radius: 20px 20px 16px 16px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0,0,0,.25);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-ios-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eee;
}
.modal-ios-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 700;
  color: #1c1a18;
}
.modal-ios-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f0efed;
  color: #6b6560;
  font-size: .85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .13s;
}
.modal-ios-close:hover { background: #e3e0dc; }

.modal-ios-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ios-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ios-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ios-step-txt {
  font-size: .85rem;
  color: #3a3836;
  line-height: 1.5;
}
.ios-share-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  background: #f0efed;
  border-radius: 5px;
  padding: 2px 4px;
  margin: 0 2px;
  color: var(--verde);
}

.ios-note {
  margin-top: 4px;
  background: #f3f8f3;
  border: 1px solid #c8e0c9;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .78rem;
  color: #2d5e31;
  line-height: 1.5;
}

/* Responsivo mobile */
@media (max-width: 680px) {
  .modal-ios-overlay { padding: 0; align-items: flex-end; }
  .modal-ios { border-radius: 20px 20px 0 0; max-width: 100%; }
}

/* ── Landscape mobile (celular deitado) ── */
@media (orientation: landscape) and (max-height: 520px) {
  body {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 16px;
  }
  .login-wrapper {
    margin: 0 auto;
  }
  .card {
    padding: 24px 28px 20px;
  }
  .card-logo {
    margin-bottom: 14px;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }
  .card-logo img {
    height: 28px;
  }
  .logo-txt {
    font-size: 1.2rem;
  }
  .lista-info {
    padding: 4px 0 10px;
    gap: 8px;
  }
  .lista-info-icon {
    width: 40px;
    height: 40px;
  }
  .card-footer {
    padding-top: 14px;
  }
  .install-bar {
    margin-bottom: 16px;
  }
}

/* ── MODAL SENHA LISTA ── */
.modal-lista-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-lista {
  background: var(--branco);
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
  animation: slideUp .25s ease;
  margin: 16px;
}

.modal-lista-header {
  display: flex;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eee;
  background: var(--verde);
}

.modal-lista-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 700;
  color: #fff;
}

.modal-lista-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-lista-desc {
  font-size: .82rem;
  color: var(--chumbo);
  line-height: 1.5;
}

.lista-senha-err {
  min-height: 18px;
  font-size: .78rem;
  color: #c0392b;
  text-align: center;
}

@media (max-width: 680px) {
  .modal-lista { max-width: 100%; border-radius: 20px 20px 0 0; }
  .modal-lista-overlay { align-items: flex-end; padding: 0; }
}

/* ── SELECAO DE DEVICE — Lista de Precos ── */
.lista-device-label {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--chumbo);
  margin-top: 8px;
  margin-bottom: 10px;
}

.lista-device-btns {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-device {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-device:active { transform: scale(.97); }

.btn-device-mobile {
  background: var(--verde);
  color: #fff;
}
.btn-device-mobile:hover { background: var(--verde-d); }

.btn-device-desktop {
  background: #f0eeec;
  color: var(--chumbo);
  border: 1.5px solid #e0ddd9;
}
.btn-device-desktop:hover { background: #e6e3e0; }

@media (max-width: 360px) {
  .lista-device-btns { flex-direction: column; }
}
