/* === Add Group – Modern Form UI === */

.add-group-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.add-group-page .page-header {
  margin-bottom: 2rem;
}

.add-group-page h1 {
  font-size: 2rem;
  margin-bottom: .5rem;
}

.add-group-page p {
  color: #666;
}

.glh-submit-form {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.05);
}

.glh-submit-form .form-group {
  margin-bottom: 1.4rem;
}

.glh-submit-form label {
  display: block;
  font-weight: 600;
  margin-bottom: .4rem;
}

.glh-submit-form label span {
  color: #e11d48;
}

.glh-submit-form input[type="text"],
.glh-submit-form input[type="url"],
.glh-submit-form textarea,
.glh-submit-form select {
  width: 100%;
  padding: .7rem .75rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}

.glh-submit-form textarea {
  resize: vertical;
}

.glh-submit-form input:focus,
.glh-submit-form textarea:focus,
.glh-submit-form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.topics-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .4rem .8rem;
}

.topics-list label {
  font-weight: 400;
  cursor: pointer;
}

.topics-list input {
  margin-right: .35rem;
}

.btn-submit {
  background: #2563eb;
  color: #fff;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.btn-submit:hover {
  background: #1e40af;
}

.btn-submit:active {
  transform: scale(.97);
}

.glh-success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

/* === Error Messages === */

/* Box de errores general en la parte superior */
.glh-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.glh-errors strong {
  display: block;
  margin-bottom: .5rem;
  font-weight: 600;
}

.glh-errors ul {
  margin: 0;
  padding-left: 1.5rem;
}

.glh-errors li {
  margin-bottom: .3rem;
}

/* Mensajes de error individuales debajo de cada campo */
.glh-error-message {
  display: block;
  color: #dc2626;
  font-size: .85rem;
  margin-top: .4rem;
  font-weight: 500;
}

.glh-error-message:empty {
  display: none;
}

/* Resaltar campos con error */
.glh-submit-form input.has-error,
.glh-submit-form select.has-error,
.glh-submit-form textarea.has-error {
  border-color: #dc2626;
}

.glh-submit-form input.has-error:focus,
.glh-submit-form select.has-error:focus,
.glh-submit-form textarea.has-error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

/* === Mobile tweaks === */
@media (max-width: 480px) {
  .glh-submit-form {
    padding: 1.5rem 1.2rem;
  }

  .add-group-page h1 {
    font-size: 1.6rem;
  }
  
  .topics-list {
    grid-template-columns: 1fr;
  }
}