/* =============================================================
   index.css — 5S Evolução Agrícola — Página de Login
   Ghost / Setor de Operações / Champz
   2026-03-31 — Reescrita: card único centralizado, 3 views por JS
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   VARIÁVEIS GLOBAIS
───────────────────────────────────────────────────────────────*/
:root {
  --laranja:     #e56425;
  --laranja-d:   #d45820;
  --verde:       #355536;
  --verde-d:     #263e28;
  --verde-claro: #edf5ed;
  --chumbo:      #5f5a56;
  --cinza-bg:    #f0eeec;
  --cinza-bd:    #e4e2e0;
  --branco:      #ffffff;
  --txt:         #1a1816;
  --txt-2:       #6b6560;
  --danger:      #c0392b;
  --ouro:        #1a1816;
  --prata:       #4a4540;
  --bronze:      #b0a8a2;
  --sucesso:     #27ae60;
}

/* ─────────────────────────────────────────────────────────────
   RESET E BASE
───────────────────────────────────────────────────────────────*/
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--txt);
}

/* ─────────────────────────────────────────────────────────────
   BODY — gradiente + padrão geométrico
───────────────────────────────────────────────────────────────*/
body {
  position: relative;
  background: linear-gradient(145deg, #263e28 0%, #355536 60%, #2e6e31 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  gap: 16px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    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;
  z-index: 0;
}

/* ─────────────────────────────────────────────────────────────
   LOGIN CARD — card único centralizado
───────────────────────────────────────────────────────────────*/
.login-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ─────────────────────────────────────────────────────────────
   CARD LOGO — logo + nome + subtítulo
───────────────────────────────────────────────────────────────*/
.card-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  text-align: center;
}

.card-logo img {
  height: 48px;
  object-fit: contain;
}

.logo-empresa {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #355536;
}

.logo-sub {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #b0a8a2;
  margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────
   VIEW ESCOLHA — tela inicial com 2 botões
───────────────────────────────────────────────────────────────*/
.escolha-desc {
  font-size: .86rem;
  color: #6b6560;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

.escolha-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─────────────────────────────────────────────────────────────
   VIEW TÍTULO — cabeçalho das views internas
───────────────────────────────────────────────────────────────*/
.view-titulo {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1816;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: -.2px;
}

/* ─────────────────────────────────────────────────────────────
   BOTÃO PRIMÁRIO — laranja
───────────────────────────────────────────────────────────────*/
.btn-primary {
  width: 100%;
  height: 50px;
  background: #e56425;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: background .15s, transform .1s;
}

.btn-primary:hover {
  background: #d45820;
}

.btn-primary:active {
  transform: scale(.98);
}

.btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
   BOTÃO OUTLINE — verde
───────────────────────────────────────────────────────────────*/
.btn-outline {
  width: 100%;
  height: 50px;
  background: transparent;
  color: #355536;
  border: 2px solid #355536;
  border-radius: 10px;
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: background .15s, color .15s, transform .1s;
}

.btn-outline:hover {
  background: #edf5ed;
}

.btn-outline:active {
  transform: scale(.98);
}

/* ─────────────────────────────────────────────────────────────
   BOTÃO VOLTAR — discreto
───────────────────────────────────────────────────────────────*/
.btn-voltar {
  width: 100%;
  height: 40px;
  background: none;
  border: none;
  color: #b0a8a2;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color .15s;
}

.btn-voltar:hover {
  color: #5f5a56;
}

/* ─────────────────────────────────────────────────────────────
   FIELDS — grupos de input
───────────────────────────────────────────────────────────────*/
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-group label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #5f5a56;
}

.field-group input {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e4e2e0;
  border-radius: 8px;
  padding: 0 14px;
  font-size: .9rem;
  color: #1a1816;
  outline: none;
  font-family: inherit;
  background: #fafaf9;
  transition: border-color .15s, box-shadow .15s;
}

.field-group input:focus {
  border-color: #355536;
  box-shadow: 0 0 0 3px rgba(53, 85, 54, .10);
  background: #fff;
}

/* ─────────────────────────────────────────────────────────────
   MENSAGEM DE ERRO
───────────────────────────────────────────────────────────────*/
.form-err {
  min-height: 20px;
  font-size: .78rem;
  color: #c0392b;
  text-align: center;
  margin-bottom: 10px;
}

/* ─────────────────────────────────────────────────────────────
   RODAPÉ DO CARD
───────────────────────────────────────────────────────────────*/
.card-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f0eeec;
  text-align: center;
  font-size: .68rem;
  color: #c4beb9;
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* ─────────────────────────────────────────────────────────────
   INSTALL BAR — abaixo do card
───────────────────────────────────────────────────────────────*/
.install-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  padding: 18px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.install-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.install-bar-msg {
  flex: 1;
  font-size: .82rem;
  color: #5f5a56;
  line-height: 1.4;
}

.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  height: 40px;
  background: #355536;
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  transition: background .15s, transform .1s;
}

.btn-install:hover {
  background: #263e28;
}

.btn-install:active {
  transform: scale(.98);
}

/* ─────────────────────────────────────────────────────────────
   MODAL iOS — instruções de instalação
───────────────────────────────────────────────────────────────*/
.modal-ios-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 20px;
}

.modal-ios-overlay.active {
  display: flex;
}

.modal-ios {
  background: #ffffff;
  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;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eee;
}

.modal-ios-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--ouro);
  margin: 0;
}

.modal-ios-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f0efed;
  color: #6b6560;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

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

.modal-ios-steps {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-ios-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--verde);
  color: var(--branco);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVO — 480px
───────────────────────────────────────────────────────────────*/
@media (max-width: 480px) {
  .login-card {
    padding: 36px 24px 28px;
    border-radius: 14px;
  }

  .logo-empresa {
    font-size: 1.2rem;
  }

  .btn-primary,
  .btn-outline {
    height: 48px;
    font-size: .9rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVO — 360px
───────────────────────────────────────────────────────────────*/
@media (max-width: 360px) {
  .login-card {
    padding: 28px 18px 22px;
  }
}

/* ─────────────────────────────────────────────────────────────
   LANDSCAPE MOBILE
───────────────────────────────────────────────────────────────*/
@media (orientation: landscape) and (max-height: 520px) {
  body {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 16px;
  }

  .login-card {
    padding: 24px 28px 20px;
  }

  .card-logo {
    margin-bottom: 16px;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }

  .card-logo img {
    height: 30px;
  }

  .logo-empresa {
    font-size: 1.1rem;
  }
}
