/* ==========================================================
   Design System & Styling - gov.br Consulte Valores a Receber
   Pixel-perfect reproduction of official gov.br portal
   ========================================================== */

:root {
  --color-primary: #1351b4;
  --color-primary-hover: #0c326f;
  --color-navy: #0c326f;
  --color-footer-bg: linear-gradient(90deg, #0C2F67 0%, #0B1D3F 100%);
  --color-text-dark: #333333;
  --color-text-muted: #555555;
  --color-bg-page: #edf1f7;
  --color-bg-alert: #ebf4fd;
  --color-border: #dcdfe4;
  --color-border-light: #e5e7eb;
  --color-error: #e53935;
  --color-success: #168821;
  --font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --card-radius: 14px;
  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.07);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-page);
  color: var(--color-text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Outer layout wrapper matching mobile proportions */
.app-viewport {
  width: 100%;
  max-width: 460px;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* ==========================================
   Header gov.br
   ========================================== */
.gov-header {
  background-color: #ffffff;
  border-bottom: 2px solid var(--color-primary);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  display: block;
  object-fit: contain;
}

.icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icons button {
  background: transparent;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: opacity 0.2s, transform 0.1s;
}

.icons button:hover {
  opacity: 0.8;
}

.icons button:active {
  transform: scale(0.95);
}

.icons button.user {
  background-color: #1451b4;
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(19, 81, 180, 0.25);
}

/* ==========================================
   Breadcrumb & Subheader Bar
   ========================================== */
.breadcrumb-bar {
  background-color: #ffffff;
  border-bottom: 1px solid #eef2f6;
  width: 100%;
}

.breadcrumb-inner {
  width: 100%;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.breadcrumb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.breadcrumb-left::-webkit-scrollbar {
  display: none;
}

.menu-toggle-btn {
  background: transparent;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  font-size: 12.5px;
  color: #4b5563;
}

.breadcrumb-list a {
  color: #4b5563;
  text-decoration: none;
}

.breadcrumb-list .separator {
  color: #6b7280;
  font-size: 13px;
  user-select: none;
}

.breadcrumb-list .active {
  color: #374151;
  font-weight: 500;
}

.breadcrumb-right {
  display: flex;
  align-items: center;
}

.search-btn {
  background: transparent;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   Main Content Area
   ========================================== */
.page-container {
  flex: 1;
  width: 100%;
  padding: 10px 0 28px 0;
  background-color: #edf1f7;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Banner Section */
.banner-section {
  width: 100%;
  padding: 0 10px;
  margin-bottom: 16px;
}

.banner-card {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
}

.banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Consultation Card */
.card-section {
  width: 100%;
  padding: 0 16px;
  display: flex;
  justify-content: center;
}

.consultation-card {
  background-color: #ffffff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  width: 100%;
  padding: 28px 22px 26px 22px;
  display: flex;
  flex-direction: column;
}

.card-title {
  color: var(--color-navy);
  font-size: 19.5px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}

.title-underline {
  width: 44px;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

/* CPF Header with Icon */
.cpf-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.cpf-badge-icon {
  width: 22px;
  height: auto;
  object-fit: contain;
  display: block;
}

.cpf-header-text {
  color: var(--color-navy);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Informational Alert */
.info-alert {
  background-color: var(--color-bg-alert);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin-bottom: 20px;
  text-align: center;
}

.info-alert p {
  color: #475569;
  font-size: 13.5px;
  line-height: 1.45;
  margin: 0;
}

.info-alert strong {
  color: var(--color-primary);
  font-weight: 700;
}

/* Form Styling */
.consult-form {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.input-container {
  position: relative;
  width: 100%;
  margin-bottom: 2px;
}

.floating-label {
  position: absolute;
  top: -8.5px;
  left: 14px;
  padding: 0 5px;
  background-color: #ffffff;
  color: var(--color-primary);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 2;
}

.cpf-input {
  width: 100%;
  height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-size: 15.5px;
  font-family: inherit;
  color: #1f2937;
  background-color: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.cpf-input::placeholder {
  color: #a0aec0;
  font-size: 15px;
}

.cpf-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(19, 81, 180, 0.12);
}

.input-container.has-error .cpf-input {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

.input-container.has-error .floating-label {
  color: var(--color-error);
}

.error-feedback {
  display: none;
  font-size: 11.5px;
  color: var(--color-error);
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 8px;
  padding-left: 2px;
}

/* Submit Button - Efeito Espelhado Suave e Elegante */
.btn-submit {
  width: 100%;
  height: 46px;
  margin-top: 10px;
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.25s, transform 0.15s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(19, 81, 180, 0.25);
  -webkit-tap-highlight-color: transparent;
}

/* Feixe de reflexo espelhado suave (Mirror Sheen) */
.btn-submit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -70%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0.08) 75%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-22deg);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

/* Dispara o reflexo suave ao passar o mouse ou tocar */
.btn-submit:hover::after,
.btn-submit.mirror-active::after {
  animation: mirrorSweep 1.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.btn-submit:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 5px 16px rgba(19, 81, 180, 0.35);
}

.btn-submit:active {
  transform: translateY(1px);
}

.btn-search-icon,
.btn-text,
.btn-spinner {
  position: relative;
  z-index: 3;
}

.btn-search-icon {
  flex-shrink: 0;
}

@keyframes mirrorSweep {
  0% {
    left: -70%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: 140%;
    opacity: 0;
  }
}

/* Loading Spinner */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-search-icon,
.btn-submit.loading .btn-text {
  display: none;
}

.btn-submit.loading .btn-spinner {
  display: block;
}

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

/* ==========================================
   Footer gov.br
   ========================================== */
.gov-footer {
  background: var(--color-footer-bg);
  color: #ffffff;
  width: 100%;
  margin-top: auto;
  padding: 30px 16px 36px 16px;
}

.footer-inner {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-logo-wrap {
  margin-bottom: 18px;
}

.footer-logo {
  height: 40px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.footer-license-title {
  font-size: 13.5px;
  color: #ffffff;
  line-height: 1.45;
  font-weight: 600;
  margin-bottom: 14px;
  max-width: 340px;
}

.footer-license-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  font-weight: 400;
  max-width: 340px;
}

/* ==========================================
   Modal Dialog
   ========================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background-color: #ffffff;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.modal-header {
  padding: 14px 18px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-gov-logo {
  height: 22px;
  width: auto;
}

.modal-header h2 {
  font-size: 15px;
  color: var(--color-navy);
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-body {
  padding: 22px 18px;
  text-align: center;
}

.success-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
}

.modal-status-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.modal-cpf-info {
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 16px;
}

.result-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  text-align: left;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13px;
}

.result-row:last-child {
  border-bottom: none;
  padding-top: 8px;
}

.result-label {
  color: #64748b;
  font-weight: 500;
}

.result-value {
  color: #1e293b;
  font-weight: 600;
}

.badge-success {
  background-color: #dcfce7;
  color: #15803d;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

.result-row.highlight .result-label {
  color: var(--color-navy);
  font-weight: 700;
  font-size: 14px;
}

.result-amount {
  color: #168821;
  font-size: 19px;
  font-weight: 800;
}

.modal-disclaimer {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 18px;
}

.btn-modal-action {
  width: 100%;
  padding: 11px;
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-modal-action:hover {
  background-color: var(--color-primary-hover);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
