/* ==========================================================================
   JESS' BOOKS - FORMULÁRIOS, BOTÕES GRANDES & UPLOAD DE IMAGEM
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label span.required {
  color: #ef4444;
}

/* CAMPO DE TÍTULO GRANDE (CONFORME SOLICITADO NO ÁUDIO) */
.input-title-large {
  width: 100%;
  height: 60px !important;
  font-size: 1.25rem !important;
  font-weight: 700;
  font-family: var(--font-serif) !important;
  padding: 0 18px !important;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 2px solid var(--border-subtle);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.input-title-large:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

/* CONTAINER DE BUSCA AUTOMÁTICA DE METADADOS */
.title-lookup-wrapper {
  position: relative;
  width: 100%;
}

.title-lookup-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-lookup-trigger {
  height: 60px;
  padding: 0 18px;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-lookup-trigger:hover {
  background: var(--accent-gold-subtle);
  border-color: var(--accent-gold);
}

.lookup-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.lookup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.lookup-item:last-child {
  border-bottom: none;
}

.lookup-item:hover {
  background: var(--accent-gold-subtle);
}

.lookup-thumb {
  width: 40px;
  height: 58px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--bg-surface-elevated);
  flex-shrink: 0;
}

.lookup-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.lookup-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* CAMPOS PADRÃO */
.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-textarea {
  height: 110px;
  padding: 14px 16px;
  resize: vertical;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 580px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .form-row-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ÁREA DE UPLOAD E PRÉVIA DA CAPA */
.image-upload-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-surface-elevated);
  transition: all var(--transition-fast);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.image-upload-zone:hover, .image-upload-zone.dragover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-subtle);
}

.upload-icon {
  font-size: 2.2rem;
  color: var(--accent-gold);
}

.upload-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.preview-container {
  display: none;
  position: relative;
  width: 140px;
  aspect-ratio: 2 / 3;
  margin: 0 auto 16px auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--accent-gold);
}

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

.btn-remove-preview {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
}

/* SELETOR INTERATIVO DE ESTRELAS */
.star-rating-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}

.star-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

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

.star-btn.selected {
  color: #fbbf24;
}

/* BOTÕES GRANDES (CONFORME SOLICITADO NO ÁUDIO) */
.btn-large {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #b45309);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--border-subtle);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* MODAL DE LOGIN INTERATIVO */
.login-hero-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-gold), #b45309);
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.login-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* MODAL DE BACKUP & EXPORTAÇÃO / IMPORTAÇÃO */
.backup-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.backup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .backup-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.backup-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  transition: all var(--transition-fast);
}

.backup-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.backup-card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.backup-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.backup-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
  flex-grow: 1;
}

.backup-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-surface-elevated);
  transition: all var(--transition-fast);
  margin-bottom: 16px;
}

.backup-dropzone:hover, .backup-dropzone.drag-over {
  border-color: var(--accent-gold);
  background: var(--accent-gold-subtle);
}

.backup-badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.backup-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.backup-feedback-box {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 0.88rem;
  animation: fadeIn 0.3s ease;
}

.backup-feedback-box.info {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.backup-feedback-box.success {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.backup-feedback-box.error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
