/* Pixel-perfect portal IPVA (referência da imagem)
   Escopo: apenas src/pages/Index.tsx (wrapper .ipva-portal) */

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

.ipva-portal {
  /* Paleta (em HSL) */
  --ipva-bg: 0 0% 100%;            /* #ffffff */
  --ipva-header: 0 0% 96%;         /* #f2f2f2 */
  --ipva-border: 0 0% 85%;         /* ~#d9d9d9 */
  --ipva-text: 210 11% 15%;        /* ~#212529 */
  --ipva-muted: 208 7% 46%;        /* ~#6c757d */
  --ipva-blue: 207 100% 29%;       /* #005394 */
  --ipva-blue-dark: 207 100% 29%;  /* #005394 */
  --ipva-danger: 352 70% 46%;      /* ~#c82333 */

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--ipva-bg));
  color: hsl(var(--ipva-text));
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ipva-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Header */
.ipva-header {
  background: hsl(var(--ipva-header));
  border-bottom: 1px solid hsl(var(--ipva-border));
}

.ipva-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.ipva-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ipva-brand img {
  height: 64px;
  width: auto;
}

.ipva-brand-line1 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.ipva-brand-line2 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.ipva-header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ipva-portal-link {
  font-size: 14px;
  color: hsl(var(--ipva-blue));
  text-decoration: underline;
}

.ipva-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid hsl(var(--ipva-blue));
  color: hsl(var(--ipva-blue));
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.ipva-login-btn:hover {
  background: #f9f9f9;
}

.ipva-login-btn svg {
  width: 18px;
  height: 18px;
}

/* Main / Title */
.ipva-main {
  flex: 1;
  background: hsl(var(--ipva-bg));
}

.ipva-title-wrap {
  padding: 28px 0 0;
}

.ipva-h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: hsl(var(--ipva-blue));
  line-height: 1.25;
}

.ipva-mascote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.ipva-bubble {
  background: #fff;
  border: 1px solid hsl(var(--ipva-border));
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  color: hsl(var(--ipva-text));
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ipva-mascote img {
  height: 80px;
  width: auto;
}

.ipva-divider {
  border: none;
  height: 1px;
  background: hsl(var(--ipva-border));
  margin: 20px 0 0;
}

/* Tabs - Menu Style */
.ipva-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0 0;
  background: #fff;
}

.ipva-tab {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 16px 14px 16px;
  background: #fff;
  border: none;
  border-bottom: 1px solid hsl(var(--ipva-border));
  border-left: 3px solid transparent;
  color: hsl(var(--ipva-blue-dark));
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.ipva-tab:first-child {
  border-top: 1px solid hsl(var(--ipva-border));
}

.ipva-tab:last-child {
  border-bottom: 1px solid hsl(var(--ipva-border));
}

.ipva-tab.active {
  background: #fff;
  border: 2px solid hsl(var(--ipva-blue));
  border-left: 3px solid hsl(var(--ipva-blue));
  color: hsl(var(--ipva-blue-dark));
  padding: 12px 14px 12px 13px;
}

.ipva-tab .ipva-caret {
  color: hsl(var(--ipva-blue));
  margin-right: 8px;
  font-size: 14px;
  font-weight: 700;
}

/* Content */
.ipva-content-wrap {
  padding: 28px 0 50px;
}

.ipva-grid {
  display: flex;
  gap: 60px;
}

.ipva-content {
  flex: 1;
}

.ipva-h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 800;
  color: hsl(var(--ipva-text));
}

.ipva-p {
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 18px;
}

.ipva-h3 {
  margin: 18px 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: hsl(var(--ipva-blue-dark));
}

.ipva-list {
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 16px;
  padding-left: 22px;
}

.ipva-list li { margin: 0 0 10px; }

.ipva-list-indent { margin-left: 22px; }

.ipva-content .ipva-list li::marker {
  color: hsl(var(--ipva-blue));
}

.ipva-link {
  color: hsl(var(--ipva-blue));
  text-decoration: underline;
}

.ipva-danger {
  color: hsl(var(--ipva-danger));
  font-weight: 700;
}

/* Aside Card */
.ipva-aside {
  width: 380px;
  flex: 0 0 380px;
}

.ipva-card {
  border: 1px solid hsl(var(--ipva-blue));
  background: #fff;
  padding: 24px;
}

.ipva-card-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
  color: hsl(var(--ipva-blue-dark));
  line-height: 1.3;
}

.ipva-label {
  display: block;
  font-size: 14px;
  margin: 0 0 10px;
}

.ipva-required { color: hsl(var(--ipva-danger)); }

.ipva-input {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  border: 1px solid hsl(var(--ipva-border));
  border-radius: 0;
  font-size: 15px;
  outline: none;
  background-color: #ffffff;
  color: #212529;
}

.ipva-actions {
  margin-top: 18px;
}

.ipva-consultar-btn {
  width: 180px;
  height: 46px;
  background: hsl(var(--ipva-blue));
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
}

/* Footer */
.ipva-footer {
  background: #fff;
  border-top: 1px solid hsl(var(--ipva-border));
  padding: 20px 0;
}

.ipva-footer p {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: hsl(var(--ipva-muted));
}

/* Loading Modal */
.ipva-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.ipva-loading-modal {
  background: #fff;
  border-radius: 0;
  padding: 36px 54px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.ipva-loading-text {
  font-size: 16px;
  color: hsl(var(--ipva-text));
  margin: 0;
}

.ipva-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid hsl(var(--ipva-border));
  border-top-color: hsl(var(--ipva-blue));
  border-radius: 50%;
  animation: ipva-spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 1100px) {
  .ipva-grid { flex-direction: column; gap: 28px; }
  .ipva-aside { width: 100%; flex: 0 0 auto; }
  .ipva-consultar-btn { width: 100%; }
}

@media (max-width: 768px) {
  .ipva-container {
    padding: 0 16px;
  }
  
  .ipva-header-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .ipva-brand {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .ipva-brand img {
    height: 50px;
  }
  
  .ipva-header-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  /* Botão Acessar sistema - usa classe .sistema-btn do shared-buttons.css */
  
  .ipva-title-wrap {
    padding: 24px 0 0;
    text-align: center;
  }
  
  .ipva-h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    text-align: center;
    line-height: 1.3;
  }
  
  .ipva-mascote {
    margin-top: 16px;
    justify-content: center;
    gap: 8px;
  }
  
  .ipva-mascote img {
    height: 75px;
  }
  
  .ipva-bubble {
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 18px;
  }
  
  .ipva-divider {
    margin: 16px 0 0;
  }
  
  .ipva-tabs {
    margin: 16px 0 0;
    background: hsl(var(--ipva-header));
    padding: 12px 12px 6px;
    border: none;
  }

  .ipva-tab {
    padding: 14px 10px;
    font-size: 15px;
    font-weight: 700;
    background: transparent;
    border: none;
    border-left: none;
  }

  .ipva-tab:first-child {
    border-top: none;
  }

  .ipva-tab:last-child {
    border-bottom: none;
  }

  .ipva-tab .ipva-caret {
    margin-right: 14px;
    font-size: 22px;
    line-height: 1;
  }

  .ipva-tab.active {
    width: 342px;
    max-width: 100%;
    height: 50px;
    padding: 10px 40px;
    background: #fff;
    border: 1px solid hsl(var(--ipva-blue));
    box-shadow: inset 0 -6px 0 hsl(var(--ipva-blue));
    justify-content: center;
    text-align: center;
  }

  .ipva-content-wrap {
    padding: 20px 0 30px;
  }
  
  .ipva-grid {
    flex-direction: column;
    gap: 24px;
  }
  
  .ipva-aside {
    width: 100%;
    flex: 0 0 auto;
    order: -1; /* Card de consulta primeiro no mobile */
  }
  
  .ipva-h2 {
    font-size: 20px;
    margin-bottom: 14px;
  }
  
  .ipva-p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
  }
  
  .ipva-h3 {
    font-size: 14px;
    margin: 14px 0 10px;
  }
  
  .ipva-list {
    font-size: 14px;
    line-height: 1.6;
    padding-left: 18px;
  }
  
  .ipva-list li {
    margin: 0 0 8px;
  }
  
  .ipva-list-indent {
    margin-left: 16px;
  }
  
  .ipva-card {
    padding: 20px;
  }
  
  .ipva-card-title {
    font-size: 16px;
  }
  
  .ipva-input {
    height: 48px;
    font-size: 16px; /* Previne zoom no iOS */
  }
  
  .ipva-consultar-btn {
    width: 100%;
    height: 48px;
    font-size: 15px;
  }
  
  .ipva-footer {
    padding: 16px 0;
  }
  
  .ipva-footer p {
    font-size: 12px;
  }
  
  .ipva-loading-modal {
    padding: 28px 32px;
    margin: 0 16px;
  }
  
  .ipva-loading-text {
    font-size: 14px;
  }
  
  .ipva-spinner {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .ipva-h1 {
    font-size: 19px;
    text-align: center;
  }
  
  .ipva-mascote {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  .ipva-bubble {
    order: 2;
    text-align: center;
  }
}
