/* ========================================================================
   GERADOR DE RELATÓRIOS DAS AUDITORIAS - STYLESHEET
   Testes de acessibilidade - GitHub
   ======================================================================== */

/* ========================================================================
   ROOT VARIABLES & RESET
   ======================================================================== */
:root {
  /* Color Palette */
  --primary-gradient: linear-gradient(135deg, #333399 0%, #4444aa 50%, #5555bb 100%);
  --primary-hover: linear-gradient(135deg, #2a2a80, #3838a0);
  --primary-color: #333399;
  --primary-shadow: rgba(51, 51, 153, 0.3);
  
  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f7fafc;
  --gray-100: #edf2f7;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e0;
  --gray-500: #718096;
  --gray-600: #4a5568;
  --gray-800: #2d3748;
  
  /* Status Colors */
  --success-bg: #f0fff4;
  --success-color: #38a169;
  --success-border: #9ae6b4;
  
  --error-bg: #fed7d7;
  --error-color: #e53e3e;
  --error-border: #feb2b2;
  
  --info-bg: #ebf8ff;
  --info-color: #3182ce;
  --info-border: #90cdf4;
  
  /* Typography */
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-size-small: 12px;
  --font-size-normal: 14px;
  --font-size-large: 24px;
  
  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;
  --spacing-2xl: 30px;
  --spacing-3xl: 40px;
  
  /* Spinner sizes */
  --spinner-sm-size: 16px;
  
  /* Indentation */
  --indent-sm: 20px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50%;
  
  /* Shadows */
  --shadow-sm: 0 8px 20px rgba(76, 99, 210, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition-base: all 0.3s ease;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ========================================================================
   LAYOUT & TYPOGRAPHY
   ======================================================================== */
body {
  background: var(--primary-color);
  min-height: 100vh;
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  padding-bottom: 80px; /* Espaço para o footer */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
  color: var(--gray-800);
}

/* Skip Link for Screen Readers */
.skip-link {
  position: absolute;
  top: -100px;
  left: -10000px;
  background: var(--white);
  color: var(--primary-color);
  padding: var(--spacing-xs) var(--spacing-sm);
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skip-link:focus {
  top: 6px;
  left: 6px;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
}

/* ========================================================================
   MAIN CONTAINER & CARD
   ======================================================================== */
.main-container {
  width: 100%;
  max-width: 500px;
  padding: 0;
}

.card {
  background: var(--white);
  border-radius: 0px !important;
  box-shadow: var(--shadow-lg);
  border-top: 0px !important;
  box-shadow: none !important;
  border: none;
  padding: var(--spacing-3xl) var(--spacing-2xl);
}

/* ========================================================================
   LOGO & BRANDING
   ======================================================================== */
.header-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  background: var(--white);
  padding: var(--spacing-3xl) var(--spacing-2xl);
  border-radius: 0px !important;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
}

.logo {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  object-fit: contain;
  /* Accessibility: Decorative image with empty alt */
}

.title-container {
  flex: 1;
  text-align: left;
}

.title {
  color: var(--primary-color);
  font-size: var(--font-size-large);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
}

.subtitle {
  color: var(--primary-color);
  font-size: var(--font-size-normal);
  margin: 0;
}

/* ========================================================================
   FORM SECTIONS & INPUTS
   ======================================================================== */
.form-section {
  margin-bottom: 25px;
  text-align: left;
}

.form-label {
  color: var(--gray-800);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  display: block;
  text-align: left;
}

.form-select {
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-500);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-normal);
  background-color: var(--white);
  color: var(--gray-800);
  transition: var(--transition-base);
  width: 100%;
  font-family: inherit;
}

.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(51, 51, 153, 0.3);
  background-color: var(--white);
  color: var(--gray-800);
  outline: none;
}

.form-select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: var(--gray-100);
  color: var(--gray-600);
  border-color: var(--gray-300);
}

.form-select option {
  background-color: var(--white);
  color: var(--gray-800);
  padding: var(--spacing-xs);
}

/* ========================================================================
   BUTTONS
   ======================================================================== */
.btn {
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-xl);
  font-weight: 500;
  transition: var(--transition-base);
  width: 100%;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  font-family: inherit;
  font-size: var(--font-size-normal);
  text-decoration: none;
}

.btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--white);
  border: 2px solid var(--gray-500);
  color: var(--gray-800);
  margin-bottom: 15px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-600);
  color: var(--gray-800);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ========================================================================
   STATUS MESSAGES
   ======================================================================== */
.status-message {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-normal);
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  /* Accessibility: Ensure status messages are announced */
  role: status;
  aria-live: polite;
  transition: opacity 0.5s ease-out;
}

.status-message.fade-out {
  opacity: 0;
}

.fetch-status-hidden {
  margin-top: var(--spacing-sm);
  visibility: hidden;
  opacity: 0;
  height: 0;
  min-height: 24px; /* Reserva espaço mínimo */
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease;
}

.fetch-status-visible {
  margin-top: var(--spacing-sm);
  visibility: visible;
  opacity: 1;
  height: auto;
  min-height: 24px;
  transition: opacity 0.3s ease, height 0.3s ease;
}

.indent-list {
  margin-left: var(--indent-sm);
}

.status-success {
  background-color: var(--success-bg);
  color: var(--success-color);
  border: 1px solid var(--success-border);
}

.status-error {
  background-color: var(--error-bg);
  color: var(--error-color);
  border: 1px solid var(--error-border);
  /* Accessibility: Errors should be announced immediately */
  aria-live: assertive;
}

.status-info {
  background-color: var(--info-bg);
  color: var(--info-color);
  border: 1px solid var(--info-border);
}

/* ========================================================================
   LOADING STATES
   ======================================================================== */
.spinner-border-sm {
  width: var(--spinner-sm-size);
  height: var(--spinner-sm-size);
  margin-right: var(--spacing-xs);
}

/* ========================================================================
   FOOTER
   ======================================================================== */
.footer {
  position: fixed;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-small);
  text-align: center;
  max-width: 90%;
}

/* ========================================================================
   UTILITY CLASSES
   ======================================================================== */
.text-muted {
  color: var(--gray-600);
  font-size: var(--font-size-small);
  text-align: left;
}

.text-muted a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
}

.text-muted a:hover,
.text-muted a:focus {
  color: var(--gray-800);
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */
@media (max-width: 576px) {
  body {
    align-items: flex-start;
    padding-top: var(--spacing-lg);
    padding-bottom: 100px; /* Mais espaço para footer em mobile */
  }
  
  .main-container {
    padding: var(--spacing-md);
    width: 100%;
    margin: 0 auto;
  }
  
  .card {
    padding: var(--spacing-xl) var(--spacing-lg);
  }
  
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }
  
  .title-container {
    text-align: center;
  }
  
  .logo {
    width: 80px;
    height: 80px;
  }
  
  .title {
    font-size: 20px;
  }
  
  .footer {
    font-size: 10px;
    padding: 0 var(--spacing-md);
    bottom: var(--spacing-md);
    max-width: 95%;
  }
}

@media (max-width: 400px) {
  body {
    padding-bottom: 120px; /* Ainda mais espaço em telas muito pequenas */
  }
  
  .logo {
    width: 60px;
    height: 60px;
  }
  
  .title {
    font-size: 18px;
  }
  
  .footer {
    font-size: 9px;
    bottom: 8px;
    padding: 0 8px;
  }
}

/* ========================================================================
   HIGH CONTRAST MODE SUPPORT
   ======================================================================== */
@media (prefers-contrast: high) {
  .btn-primary {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
  }
  
  .btn-secondary {
    border: 2px solid #000;
    background: #fff;
    color: #000;
  }
  
  .form-select {
    border: 3px solid #000;
    background-color: #fff;
    color: #000;
  }
  
  .form-select:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px #000;
  }
  
  .form-label {
    color: #000;
  }
  
  .text-muted {
    color: #000;
  }
  
  .text-muted a {
    color: #000;
    text-decoration: underline;
    border-bottom: 2px solid #000;
  }
}

/* ========================================================================
   REDUCED MOTION SUPPORT
   ======================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .btn:hover:not(:disabled) {
    transform: none;
  }
}

/* ========================================================================
   PRINT STYLES
   ======================================================================== */
@media print {
  body {
    background: white;
  }
  
  .footer {
    position: static;
    transform: none;
    color: black;
  }
  
  .btn {
    border: 1px solid black;
  }
}