/* === RESET GLOBAL === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === BASE === */
body {
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* === HEADER === */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* === LAYOUT === */
.main-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.form-container {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

/* === SEÇÕES DO FORMULÁRIO === */
.form-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
}

.form-section h3 {
  color: #667eea;
  font-weight: bold;
  margin-bottom: 1rem;
  font-size: 1.6rem;
  border-bottom: 2px solid #667eea;
  padding-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* === BOTÕES === */
.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.3s;
  margin-right: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn-secondary {
  background: #6c757d;
}

.btn-danger {
  background: #dc3545;
}

/* === LISTA === */
.personas-list {
  margin-top: 1rem;
}

.persona-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.persona-item:hover {
  background: #eef2ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}

/* === PERSONA ATIVA (SELECIONADA) === */
.persona-item.active {
  background: #e0e7ff;
  border-left-color: #4338ca;
  box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.2);
}

.persona-info {
  flex: 1;
}

.persona-info strong {
  display: block;
  color: #111827;
  font-weight: 600;
}

.persona-info small {
  color: #6b7280;
  font-size: 0.9rem;
}

.persona-actions {
  margin-left: 10px;
}

.persona-actions .btn-delete {
  background: #ef4444;
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 10px;
  transition: background 0.2s ease;
}

.persona-actions .btn-delete:hover {
  background: #dc2626;
}

/* === BOTÃO DE EXPORTAÇÃO === */
.btn-export {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.9rem 1.5rem;
  margin-top: 1rem;
  text-align: center;
  transition: opacity 0.3s ease;
}

.btn-export:hover {
  opacity: 0.9;
}

/* === ALERTAS === */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* === LOADING === */
.loading {
  display: none;
  text-align: center;
  padding: 2rem;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .header h1 {
    font-size: 2rem;
  }

  .container {
    padding: 10px;
  }
}
