/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.visible {
  opacity: 1;
}

.modal {
  background: var(--color-branco);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.visible .modal {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-verde-muted);
}

.modal__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-texto);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-texto-muted);
  font-size: var(--text-xl);
  transition: all var(--transition-fast);
}

.modal__close:hover {
  background: var(--color-fundo-alt);
  color: var(--color-texto);
}

.modal__body {
  padding: var(--space-5) var(--space-6);
}

.modal__footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-verde-muted);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 500;
  pointer-events: all;
  animation: toast-in 300ms ease forwards;
  max-width: 320px;
}

.toast.saindo {
  animation: toast-out 300ms ease forwards;
}

.toast--sucesso {
  background: var(--color-sucesso);
  color: var(--color-branco);
}

.toast--erro {
  background: var(--color-erro);
  color: var(--color-branco);
}

.toast--info {
  background: var(--color-azul-unesp);
  color: var(--color-branco);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .toast.saindo { animation: none; opacity: 0; }
}

/* Gallery */
.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.gallery__main {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-bege);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.gallery__main:hover img {
  transform: scale(1.03);
}

.gallery__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-texto-muted);
}

.gallery__placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.gallery__thumbs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}

.gallery__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.gallery__thumb.active {
  border-color: var(--color-verde-medio);
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  animation: lightbox-in 200ms ease;
}

.lightbox__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: var(--text-xl);
  transition: background var(--transition-fast);
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox__legenda {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: var(--text-sm);
  text-align: center;
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Stars */
.stars-selector {
  display: flex;
  gap: var(--space-1);
}

.star-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.star-btn:hover {
  transform: scale(1.2);
}

.star-btn svg {
  width: 28px;
  height: 28px;
}

.stars-display {
  display: inline-flex;
  gap: 2px;
}

.stars-display svg {
  width: 16px;
  height: 16px;
}

/* Form fields */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-texto);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-verde-muted);
  border-radius: var(--radius-md);
  background: var(--color-branco);
  color: var(--color-texto);
  transition: border-color var(--transition-fast);
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-verde-medio);
  box-shadow: 0 0 0 3px rgba(74,140,111,0.15);
}

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

.form-group .field-error {
  font-size: var(--text-xs);
  color: var(--color-erro);
}

/* Card */
.card {
  background: var(--color-branco);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Drag-and-drop upload */
.upload-area {
  border: 2px dashed var(--color-verde-muted);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--color-texto-muted);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--color-verde-medio);
  background: rgba(74,140,111,0.05);
}

.upload-area svg {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--space-2);
  opacity: 0.5;
}

.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.upload-preview {
  position: relative;
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-verde-muted);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: var(--color-erro);
  color: white;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
