/* ===============================================
   ANAMNESE - CSS PROFISSIONAL E ELEGANTE
   José W. Trainer - Paleta: Preto, Branco, Laranja
   Design Premium para Formulários Médicos
   =============================================== */

/* Variáveis CSS para anamnese */
:root {
  /* Cores principais */
  --laranja-primario: #ff6b35;
  --laranja-escuro: #e55a2b;
  --laranja-claro: #ff8c69;
  --preto: #000000;
  --cinza-escuro: #1f2937;
  --cinza-medio: #374151;
  --cinza-claro: #f8f8f8;
  --branco: #ffffff;
  
  /* Gradientes elegantes */
  --gradiente-laranja: linear-gradient(135deg, var(--laranja-primario), var(--laranja-escuro));
  --gradiente-fundo: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 50%, #f8f8f8 100%);
  --gradiente-form: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 248, 248, 0.8));
  
  /* Sombras refinadas */
  --sombra-card: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.03);
  --sombra-hover: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(255, 107, 53, 0.1);
  --sombra-input: 0 2px 8px rgba(0, 0, 0, 0.04);
  --sombra-botao: 0 4px 15px rgba(255, 107, 53, 0.3);
  
  /* Transições suaves */
  --transicao: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transicao-suave: all 0.2s ease-out;
}

/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--gradiente-fundo);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--cinza-escuro);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Efeito de padrão sutil no fundo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 107, 53, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* Header refinado */
header {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 107, 53, 0.1);
  position: relative;
  z-index: 10;
}

/* Seção principal */
.section {
  position: relative;
  z-index: 5;
  padding: 3rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section h2 {
  text-align: center;
  font-size: 3.5rem;
  font-weight: 700;
  color: transparent;
  margin-bottom: 4rem;
  letter-spacing: 2px;
  position: relative;
  display: block;
  width: 100%;
  padding: 2rem 0;
  
  /* Gradiente animado no texto */
  background: linear-gradient(
    45deg,
    var(--laranja-primario),
    var(--preto),
    var(--laranja-claro),
    var(--branco),
    var(--laranja-escuro)
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease-in-out infinite;
  
  /* Sombra dinâmica */
  filter: drop-shadow(0 4px 20px rgba(255, 107, 53, 0.3));
  
  /* Texto com efeito de brilho nas bordas */
  text-shadow: 
    0 0 20px rgba(255, 107, 53, 0.3),
    0 0 40px rgba(0, 0, 0, 0.2),
    0 0 60px rgba(255, 107, 53, 0.1);
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
    transform: scale(1);
    filter: drop-shadow(0 4px 20px rgba(255, 107, 53, 0.3));
  }
  25% {
    background-position: 100% 50%;
    transform: scale(1.02);
    filter: drop-shadow(0 6px 25px rgba(0, 0, 0, 0.4));
  }
  50% {
    background-position: 0% 100%;
    transform: scale(1);
    filter: drop-shadow(0 4px 20px rgba(255, 107, 53, 0.3));
  }
  75% {
    background-position: 100% 0%;
    transform: scale(1.02);
    filter: drop-shadow(0 6px 25px rgba(0, 0, 0, 0.4));
  }
}

/* Linha decorativa animada embaixo do título */
.section h2::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--laranja-primario),
    var(--laranja-primario),
    var(--laranja-primario)
  );
  background-size: 200% 100%;
  border-radius: 2px;
  animation: lineGrow 2s ease-out 0.5s both, lineShimmer 3s ease-in-out 2.5s infinite;
}

@keyframes lineGrow {
  from {
    width: 0;
  }
  to {
    width: 200px;
  }
}

@keyframes lineShimmer {
  0%, 100% {
    background-position: -100% 0;
  }
  50% {
    background-position: 100% 0;
  }
}

/* Elementos decorativos flutuantes ao redor do título */
.section h2::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -3rem;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  background: var(--laranja-primario);
  border-radius: 50%;
  box-shadow: 
    0 0 20px rgba(255, 107, 53, 0.6),
    0 0 40px rgba(255, 107, 53, 0.3);
  animation: floatLeft 3s ease-in-out infinite;
}

/* Elemento decorativo do lado direito */
.section::before {
  content: '';
  position: absolute;
  top: 120px;
  right: calc(50% - 200px);
  width: 12px;
  height: 12px;
  background: var(--laranja-primario);
  border-radius: 50%;
  box-shadow: 
    0 0 15px rgba(255, 107, 53, 0.6),
    0 0 30px rgba(255, 107, 53, 0.3);
  animation: floatRight 3s ease-in-out infinite 0.5s;
}

/* Partículas pequenas animadas */
.section::after {
  content: '';
  position: absolute;
  top: 100px;
  left: calc(50% - 150px);
  width: 8px;
  height: 8px;
  background: var(--laranja-claro);
  border-radius: 50%;
  box-shadow: 
    0 0 10px rgba(252, 211, 77, 0.6),
    20px 30px 0 -2px var(--laranja-claro),
    40px -20px 0 -3px var(--laranja-primario),
    -30px 40px 0 -2px var(--laranja-primario);
  animation: sparkle 4s ease-in-out infinite;
}

@keyframes floatLeft {
  0%, 100% {
    transform: translateY(-50%) translateX(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-50%) translateX(-10px) scale(1.2);
    opacity: 1;
  }
}

@keyframes floatRight {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateX(10px) scale(1.3);
    opacity: 1;
  }
}

@keyframes sparkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.7;
  }
  25% {
    transform: scale(1.2) rotate(90deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.8) rotate(180deg);
    opacity: 0.8;
  }
  75% {
    transform: scale(1.1) rotate(270deg);
    opacity: 1;
  }
}

/* Efeito de hover interativo no título */
.section h2:hover {
  animation-duration: 1s;
  cursor: default;
}

.section h2:hover::after {
  animation-duration: 1s;
}

/* Efeito de typewriter ao carregar */
.section h2.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 2s steps(15) 0.5s both, gradientShift 4s ease-in-out 2.5s infinite;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}



/* Responsividade para o título dinâmico */
@media (max-width: 768px) {
  .section h2 {
    font-size: 2.5rem;
    letter-spacing: 1px;
    padding: 1.5rem 0;
  }
  
  .section h2::before {
    left: -2rem;
    width: 12px;
    height: 12px;
  }
  
  .section::before {
    right: calc(50% - 150px);
    width: 10px;
    height: 10px;
  }
  
  .section h2::after {
    bottom: -15px;
  }
  
  @keyframes lineGrow {
    to {
      width: 150px;
    }
  }
}

@media (max-width: 480px) {
  .section h2 {
    font-size: 2rem;
    letter-spacing: 0.5px;
  }
  
  .section h2::before {
    display: none;
  }
  
  .section::before,
  .section::after {
    display: none;
  }
  
  @keyframes lineGrow {
    to {
      width: 120px;
    }
  }
}

/* Efeito especial: pulso no título quando a página carrega */
.section h2.pulse-effect {
  animation: 
    titlePulse 1s ease-out,
    gradientShift 4s ease-in-out 1s infinite;
}

@keyframes titlePulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Modo escuro para o título - REMOVIDO */
/* @media (prefers-color-scheme: dark) {
  .section h2 {
    text-shadow: 
      0 0 25px rgba(255, 107, 53, 0.4),
      0 0 50px rgba(255, 107, 53, 0.3),
      0 0 75px rgba(255, 107, 53, 0.2);
  }
} */

/* ===============================================
   FORMULÁRIO - ESTILIZAÇÃO E ANIMAÇÕES
   =============================================== */

/* Container do formulário */
.form-section {
  max-width: 800px;
  margin: 0 auto;
  background: var(--gradiente-form);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: var(--sombra-card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Borda sutil animada */
.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 107, 53, 0.1) 0%, 
    transparent 50%, 
    rgba(255, 107, 53, 0.1) 100%);
  border-radius: 24px;
  z-index: -1;
  opacity: 0.7;
}

/* Introdução do formulário */
.form-intro {
  background: linear-gradient(135deg, 
    rgba(255, 107, 53, 0.08) 0%, 
    rgba(255, 107, 53, 0.05) 100%);
  border: 1px solid rgba(255, 107, 53, 0.2);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  border-left: 4px solid var(--laranja-primario);
}

.form-intro p {
  margin-bottom: 1rem;
  color: var(--cinza-escuro);
  line-height: 1.7;
}

.form-intro p:last-child {
  margin-bottom: 0;
  font-weight: 500;
  color: var(--laranja-escuro);
}

/* Grupos de campos */
.form-group {
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(even) {
  animation-delay: 0.1s;
}

.form-group:nth-child(odd) {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Labels */
label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 500;
  color: var(--laranja-escuro);
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.required::after {
  content: '*';
  color: #ef4444;
  margin-left: 0.3rem;
  font-weight: 600;
}

/* Campos de entrada */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 2px solid rgba(255, 107, 53, 0.1);
  border-radius: 12px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.8);
  transition: var(--transicao);
  font-family: inherit;
  box-shadow: var(--sombra-input);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--laranja-primario);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
  background: var(--branco);
  transform: translateY(-2px);
}

/* Select customizado */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 3rem;
}

/* Textarea */
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Grupos de radio e checkbox */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  border-radius: 10px;
  transition: var(--transicao-suave);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 107, 53, 0.1);
}

.radio-option:hover,
.checkbox-option:hover {
  background: rgba(255, 107, 53, 0.05);
  border-color: rgba(255, 107, 53, 0.2);
}

.radio-option input,
.checkbox-option input {
  width: auto;
  margin-right: 0.8rem;
  transform: scale(1.2);
  accent-color: var(--laranja-primario);
}

.radio-option label,
.checkbox-option label {
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
}

/* Termos e condições */
.terms {
  background: linear-gradient(135deg, 
    rgba(34, 197, 94, 0.08) 0%, 
    rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 16px;
  padding: 2rem;
  margin: 2.5rem 0;
  border-left: 4px solid #22c55e;
  position: relative;
}

.terms p {
  margin-bottom: 1rem;
  color: var(--cinza-escuro);
  line-height: 1.6;
}

.terms ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.terms li {
  margin-bottom: 0.5rem;
  color: var(--cinza-medio);
}

/* Botão de envio */
.submit-btn {
  background: var(--gradiente-laranja);
  color: var(--preto);
  padding: 1.2rem 3rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transicao);
  box-shadow: var(--sombra-botao);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 1rem;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4), 0 4px 15px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:active {
  transform: translateY(-1px);
}

/* Estados de validação */
input:invalid,
select:invalid,
textarea:invalid {
  border-color: rgba(239, 68, 68, 0.3);
}

input:valid,
select:valid,
textarea:valid {
  border-color: rgba(34, 197, 94, 0.3);
}

/* Responsividade */
@media (max-width: 768px) {
  .section {
    padding: 2rem 1rem;
  }
  
  .section h2 {
    font-size: 2rem;
  }
  
  .form-section {
    padding: 2rem;
    border-radius: 20px;
    margin: 1rem;
  }
  
  .form-intro {
    padding: 1.5rem;
  }
  
  .form-group {
    margin-bottom: 1.5rem;
  }
  
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    padding: 0.9rem 1rem;
  }
  
  .submit-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .form-section {
    padding: 1.5rem;
    margin: 0.5rem;
  }
  
  .form-intro {
    padding: 1rem;
  }
  
  .radio-group,
  .checkbox-group {
    gap: 0.8rem;
  }
  
  .radio-option,
  .checkbox-option {
    padding: 0.6rem;
  }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Modo escuro - REMOVIDO */
/* @media (prefers-color-scheme: dark) {
  :root {
    --gradiente-fundo: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
    --gradiente-form: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.8));
    --cinza-escuro: #f1f5f9;
    --cinza-medio: #e2e8f0;
  }
  
  .form-section {
    background: var(--gradiente-form);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--cinza-escuro);
  }
  
  .radio-option,
  .checkbox-option {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
  }
} */

/* Loading state para o formulário */
.form-section.loading {
  pointer-events: none;
  opacity: 0.7;
}

.form-section.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 107, 53, 0.3);
  border-top: 3px solid var(--laranja-primario);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Indicador de progresso sutil */
.form-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradiente-laranja);
  transition: width 0.3s ease;
  z-index: 1000;
}

/* Efeitos de micro-interação */
.form-group:hover label {
  color: var(--laranja-primario);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 107, 53, 0.3);
}

/* Feedback visual para campos obrigatórios */
.form-group.required-field label {
  position: relative;
}

.form-group.required-field label::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  opacity: 0.7;
}
