/* ================================================================
   Meopp ART Mutual – Frontend Styles
   Palette:  verde-oscuro #1b5e20 | verde-principal #2e7d32
             verde-medio  #388e3c | verde-claro #c8e6c9
             texto        #1a1a2e | fondo #f5f7f5
   ================================================================ */

/* ── Reset / base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f5f7f5;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header / Banner ──────────────────────────────────────────── */
.site-header {
  width: 100%;
  background: #2e7d32;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.header-banner {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

/* ── Section titles ───────────────────────────────────────────── */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1b5e20;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: -0.5px;
}

/* ── Events grid ──────────────────────────────────────────────── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

/* ── Event Card ───────────────────────────────────────────────── */
.event-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(46,125,50,.10);
  border: 1px solid #e8f5e9;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(46,125,50,.18);
}

.event-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: linear-gradient(135deg, #2e7d32, #81c784);
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card-image-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card-image-placeholder .ev-icon {
  font-size: 3rem;
  opacity: .6;
}

.event-card-body {
  padding: 1.4rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.event-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1b5e20;
  line-height: 1.3;
}

.event-meta {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .875rem;
  color: #555;
}

.event-meta .meta-icon { flex-shrink: 0; font-size: 1rem; }

.event-card-desc {
  font-size: .875rem;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-footer {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e8f5e9;
  background: #fafffe;
}

.badge-lugares {
  font-size: .8rem;
  font-weight: 600;
  padding: .25rem .75rem;
  border-radius: 20px;
}

.badge-lugares.disponible {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-lugares.lleno {
  background: #ffebee;
  color: #c62828;
}

.btn-registrar {
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: .55rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background .15s ease;
  letter-spacing: .5px;
}

.btn-registrar:hover  { background: #1b5e20; }
.btn-registrar:disabled { background: #9e9e9e; cursor: default; }

/* ── Loading / Empty states ───────────────────────────────────── */
.loading-state {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
  color: #555;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e8f5e9;
  border-top-color: #2e7d32;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem;
  color: #666;
}

/* ── Registration section ─────────────────────────────────────── */
.registration-section {
  max-width: 560px;
  margin: 0 auto;
}

.btn-back {
  background: none;
  border: none;
  color: #2e7d32;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: .5rem 0;
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transition: color .15s;
}

.btn-back:hover { color: #1b5e20; }

.registration-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.09);
  border: 1px solid #e8f5e9;
}

.registration-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1a1a2e;
  text-align: center;
  margin-bottom: .4rem;
}

.registration-event-name {
  text-align: center;
  color: #2e7d32;
  font-weight: 600;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ── Floating label fields ────────────────────────────────────── */
.form-field {
  position: relative;
  margin-bottom: 1.25rem;
}

.form-field input {
  width: 100%;
  padding: 1.1rem 1rem .4rem;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  color: #1a1a2e;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}

.form-field input:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}
.form-field input:-webkit-autofill,
.form-field input:-webkit-autofill:hover,
.form-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: #1a1a2e;
}

.form-field label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 1rem;
  pointer-events: none;
  transition: .15s ease;
  background: transparent;
}

.form-field input:focus   + label,
.form-field input:not(:placeholder-shown) + label,
.form-field input:-webkit-autofill + label,
.form-field input:autofill + label {
  top: .45rem;
  transform: none;
  font-size: .72rem;
  color: #2e7d32;
  font-weight: 600;
}

.form-field input.invalid { border-color: #e53935; }

.field-error {
  font-size: .78rem;
  color: #e53935;
  margin-top: .25rem;
  display: block;
  min-height: 1em;
}

/* ── Submit button ────────────────────────────────────────────── */
.btn-submit {
  width: 100%;
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: .9rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .15s ease;
}

.btn-submit:hover    { background: #1b5e20; }
.btn-submit:disabled { background: #9e9e9e; cursor: default; }

.btn-primary {
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: .7rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: #1b5e20; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 1rem 1.2rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: .9rem;
  font-weight: 500;
}

.alert-success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.alert-error {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ef9a9a;
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
  animation: fadeUp .25s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-icon  { font-size: 3rem; margin-bottom: 1rem; }
.modal-title { font-size: 1.4rem; font-weight: 700; color: #1b5e20; margin-bottom: .75rem; }
.modal-body  { color: #555; margin-bottom: 1.5rem; line-height: 1.6; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  background: #1b5e20;
  color: #c8e6c9;
  text-align: center;
  padding: 1.25rem;
  font-size: .85rem;
}

/* ── Utilities ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .events-grid { grid-template-columns: 1fr; }
  .registration-card { padding: 2rem 1.25rem; }
  .section-title { font-size: 1.5rem; }
}
