body.apa-generator-body {
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 65%);
}

.apa-generator-hero {
  text-align: center;
  padding: 120px 20px 60px;
}

.apa-generator-hero h1 {
  font-size: 3rem;
  margin-bottom: 16px;
  color: #1f2a56;
}

.apa-generator-hero p {
  font-size: 1.1rem;
  max-width: 720px;
  margin: 0 auto;
  color: #4c5065;
}

.apa-generator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.08);
  margin: -60px auto 40px;
  max-width: 1100px;
}

.apa-generator-card form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.model-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.model-card {
  border: 1px solid #d9e2ff;
  border-radius: 18px;
  padding: 18px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.model-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.model-card .checkmark {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #b7c0e7;
}

.model-card.selected {
  border: 1px solid #7f8fff;
  box-shadow: 0 12px 30px rgba(127, 143, 255, 0.2);
}

.model-card.selected .checkmark {
  background: #7f8fff;
  border-color: #7f8fff;
}

.model-name {
  font-weight: 600;
  color: #1f2a56;
  display: flex;
  gap: 8px;
  align-items: center;
}

.model-desc {
  color: #555c76;
  font-size: 0.95rem;
  margin: 0;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature {
  background: #f4f6ff;
  color: #5d63a3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metadata-grid label {
  font-weight: 600;
  color: #1d1d3b;
  margin-bottom: 6px;
  display: block;
}

.metadata-grid input {
  width: 100%;
  border: 1px solid #d6dbf2;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
}

.apa-textarea-wrapper {
  position: relative;
}

.apa-textarea-wrapper button.clear {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  color: #6b7280;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
}

.apa-textarea-wrapper textarea {
  width: 100%;
  min-height: 260px;
  border: 1px solid #cad4f5;
  border-radius: 14px;
  padding: 18px;
  font-size: 0.98rem;
  font-family: 'Georgia', serif;
  resize: vertical;
  transition: border 0.2s ease;
}

.apa-textarea-wrapper textarea.error {
  border-color: #f47272;
  box-shadow: 0 0 0 2px rgba(244, 114, 114, 0.2);
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.word-count-label {
  font-size: 0.95rem;
  color: #4b4f74;
}

.word-count-label strong {
  font-size: 1.2rem;
  color: #1f2a56;
}

.generate-btn {
  background: linear-gradient(135deg, #6b7bff 0%, #857bff 100%);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  padding: 14px 26px;
  font-weight: 600;
  cursor: pointer;
  min-width: 220px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.apa-guidance {
  max-width: 1100px;
  margin: 0 auto 70px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.guidance-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid #e2e6fb;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.06);
}

.guidance-card h3 {
  margin-bottom: 12px;
  color: #1f2a56;
}

.guidance-card p,
.guidance-card li {
  color: #4c4f72;
  line-height: 1.6;
}

.apa-status {
  margin-top: 8px;
  font-size: 0.95rem;
}

.apa-status.error {
  color: #c62828;
}

.apa-status.success {
  color: #2e7d32;
}

.apa-loader {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 24, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.apa-loader.visible {
  opacity: 1;
  pointer-events: auto;
}

.apa-loader .spinner {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffffff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .apa-generator-card {
    padding: 22px;
  }

  .generate-btn {
    width: 100%;
  }
}

