/*
 * Momo Review — Form atoms (shared).
 *
 * Reusable form controls: rows, labels, inputs, textareas, file inputs,
 * buttons, messages, password section. Was previously duplicated across
 * write-review.css + profile.css; now consolidated here.
 *
 * Any page that uses a form (write-review, profile-edit, new-topic) must
 * enqueue this CSS + momo-buttons.
 */

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

@media (max-width: 640px) {
  .form-row--two { grid-template-columns: 1fr; }
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.form-label .req {
  color: #ef4444;
  font-weight: 700;
}

.form-label .hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-light);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 4px 0 0;
  line-height: 1.4;
}

/* Tip variant — used for important guidance (e.g. recommended image dimensions).
   Soft pink/blue background + small icon to make it more visible than a plain hint. */
.form-hint--tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin: 8px 0 0;
  background: linear-gradient(135deg, rgba(255, 140, 163, 0.08), rgba(108, 176, 199, 0.08));
  border: 1px dashed var(--primary-light, #ffb8c5);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.825rem;
  line-height: 1.5;
}

.form-hint--tip::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8ca3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='12' y1='16' x2='12' y2='12'/><line x1='12' y1='8' x2='12.01' y2='8'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

.form-hint--tip strong {
  color: var(--primary, #ff8ca3);
  font-weight: 700;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 140, 163, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

.form-content {
  min-height: 200px;
}

.form-file {
  padding: 10px 12px;
  cursor: pointer;
}

.form-file::file-selector-button {
  margin-right: 12px;
  padding: 6px 14px;
  border: 0;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--primary), #ff6b8b);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.form-actions .btn { text-decoration: none; }

.form-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm, 10px);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.form-message.is-error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.3);
}

.form-message.is-success {
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.3);
}
