/* Membership card — matches LARSH print design */

.enroll-page { padding-bottom: 3rem; }

.enroll-hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(13, 159, 79, 0.14), transparent 42%),
    linear-gradient(180deg, #f3f7f3 0%, var(--bg, #f5f7f5) 100%);
}

.enroll-section { padding-top: 0.5rem; }
.enroll-form { display: grid; gap: 1.5rem; }

.membership-deck {
  --cream: #f7f3e8;
  --cream-deep: #efe8d8;
  --ink: #1c1c1c;
  --muted: #5a5a5a;
  --green: #0b6f36;
  --green-deep: #085a2b;
  --green-soft: #6f9f4a;
  --blue: #1f5f9b;
  --line: #7d9a7d;
  --red: #c62828;
  display: grid;
  gap: 1.25rem;
  width: min(100%, 980px);
  max-width: 980px;
  margin-inline: auto;
}

.mcard {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1.5px solid #c9c2b0;
  background: var(--cream);
  box-shadow: 0 12px 34px rgba(40, 50, 30, 0.12);
  color: var(--ink);
}

.mcard-leaf-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath fill='%230b6f36' d='M60 8c18 18 28 34 28 52 0 20-12 36-28 52C44 96 32 80 32 60c0-18 10-34 28-52zm0 20c-8 10-14 20-14 32s6 22 14 32c8-10 14-20 14-32s-6-22-14-32z'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  background-position: center;
  z-index: 0;
}

.mcard-back-grid,
.mcard-back-banner {
  position: relative;
  z-index: 1;
}

.mcard-declaration,
.mcard-info-head h3,
.mcard-goals h3,
.mcard-field-label {
  letter-spacing: normal !important;
  font-feature-settings: "liga" 1, "calt" 1;
  unicode-bidi: isolate;
}

/* ===== FRONT: official art + editable overlays (1024×334) ===== */
.mcard-front {
  position: relative;
  width: 100%;
  background: #f7f3e8;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(40, 50, 30, 0.14);
  container-type: inline-size;
  container-name: mfront;
}

/* In-flow image sets the card height — overlays use the same box */
.mcard-front-art {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.mcard-front-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.mcard-ui {
  position: absolute !important;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #111;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
}

/* Exact coordinates measured from the 1024×334 artwork */
.mcard-ui-reg {
  top: 9.3% !important;
  right: 4.1% !important;
  width: 15.8% !important;
  height: 16.5% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #0b6f36;
  font-size: 1.35cqw;
}

/* Photo: inside the green frame at x=820..982, y=105..281 */
.mcard-ui-photo {
  top: 31.4% !important;
  right: 4.1% !important;
  width: 15.8% !important;
  height: 52.7% !important;
  border-radius: 0.65cqw;
  cursor: pointer;
  display: block !important;
  background: transparent !important;
  overflow: hidden;
}

.mcard-ui-photo--static { cursor: default; }

.mcard-ui-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5cqw;
  background: #fff;
}

.mcard-ui-photo img[hidden],
.mcard-ui-photo-hint[hidden] {
  display: none !important;
}

.mcard-ui-photo-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8%;
  text-align: center;
  font-size: 1.2cqw;
  font-weight: 700;
  color: #0b6f36;
  background: transparent !important;
  pointer-events: none;
}

/* Text regions span only the dotted lines at x=475..675 */
.mcard-ui-name,
.mcard-ui-date {
  left: 46.4% !important;
  width: 19.5% !important;
  height: 8.3% !important;
  display: flex !important;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  outline: none;
  background: transparent !important;
  font-size: clamp(11px, 1.65cqw, 18px);
  padding-bottom: 0.15cqw !important;
  white-space: nowrap;
  overflow: visible;
}

.mcard-ui-name.mcard-ui--text,
.mcard-ui-date.mcard-ui--text {
  color: #111;
  font-weight: 800;
  letter-spacing: normal;
  unicode-bidi: isolate;
}

.mcard-ui-name {
  top: 59.5% !important;
}

.mcard-ui-date {
  top: 72.8% !important;
}

input.mcard-ui-name:focus {
  background: rgba(255, 255, 255, 0.35) !important;
}

/* ===== BACK ===== */
.mcard-back-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 1rem;
  padding: 1rem 1.15rem 1rem;
}

.mcard-info {
  border: 1px solid #d2cbb8;
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
  padding: 0.85rem 0.9rem 0.7rem;
}

.mcard-info-head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green);
  color: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.8rem 0.28rem 0.35rem;
  margin-bottom: 0.8rem;
}

.mcard-info-head h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
}

.mcard-info-icon {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #fff;
  position: relative;
}

.mcard-info-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 36%, var(--green) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 78%, var(--green) 0 28%, transparent 29%);
}

.mcard-field {
  display: grid;
  grid-template-columns: 9.6rem 1fr;
  gap: 0.4rem;
  align-items: end;
  margin-bottom: 0.42rem;
}

.mcard-field label,
.mcard-field-label {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.mcard-field input,
.mcard-field-value {
  width: 100%;
  border: none;
  border-bottom: 1.5px dotted var(--line);
  background: transparent;
  padding: 0.2rem 0.15rem;
  font: inherit;
  color: #111;
  outline: none;
  min-height: 1.4em;
}

.mcard-field input:focus {
  border-bottom-color: var(--green);
  background: rgba(11,111,54,0.04);
}

.mcard-field-split { align-items: start; }
.mcard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.mcard-president {
  margin-top: 0.85rem;
  border-top: 1px dashed #c4bda8;
  padding-top: 0.65rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--green);
  font-weight: 800;
  font-size: 0.88rem;
}

.mcard-president em {
  flex: 1;
  border-bottom: 1.5px dotted var(--line);
  font-style: normal;
  min-height: 1.2rem;
}

.mcard-goals {
  border: 1px solid #d2cbb8;
  border-radius: 14px;
  padding: 0.9rem;
  background: rgba(255,255,255,0.4);
}

.mcard-goals h3 {
  color: var(--ink);
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.mcard-goals ul {
  list-style: disc;
  padding-inline-start: 1.15rem;
  display: grid;
  gap: 0.4rem;
  color: #243024;
  font-size: 0.84rem;
  margin: 0 0 0.85rem;
}

.mcard-declaration {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.7;
  border-top: 1px dashed #e0b4b4;
  padding-top: 0.7rem;
  margin: 0;
}

.mcard-back-banner {
  background: linear-gradient(90deg, #6f9f4a, #8bb85f 50%, #6f9f4a);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
}

/* extras */
.enroll-extras {
  max-width: 940px;
  margin-inline: auto;
  display: grid;
  gap: 1rem;
}

.enroll-idcard-box,
.enroll-admin-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px dashed #9fc39f;
  background: rgba(13,159,79,0.06);
}

.enroll-admin-meta {
  border-style: solid;
  background: #fff;
}

.enroll-idcard-box h3,
.enroll-admin-meta h3 {
  font-size: 1rem;
  color: var(--green);
  margin-bottom: 0.2rem;
}

.enroll-idcard-box p,
.enroll-admin-meta p {
  color: var(--text-muted, #5a5a5a);
  font-size: 0.88rem;
}

.enroll-idcard-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #fff;
  border: 1px solid #b7d2b7;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--green);
}

.enroll-idcard-upload input { max-width: 14rem; }

.enroll-privacy {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e0e5e0);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.enroll-submit {
  width: 100%;
  min-height: 3rem;
  font-size: 1.05rem;
}

.admin-card-panel .membership-deck,
.admin-card-panel .enroll-extras,
.card-preview-modal .membership-deck {
  max-width: none;
}

.admin-card-panel .modal-box,
.card-preview-modal .modal-box {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
}

.card-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.card-preview-actions .btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Keep print/export colors stable even in dark theme */
[data-theme="dark"] .mcard,
[data-theme="dark"] .mcard-info,
[data-theme="dark"] .mcard-goals {
  color: var(--ink);
}

[data-theme="dark"] .enroll-idcard-box,
[data-theme="dark"] .enroll-privacy,
[data-theme="dark"] .enroll-admin-meta {
  background: rgba(13,159,79,0.08);
  border-color: #35503a;
}

@media (max-width: 860px) {
  .membership-deck {
    width: 100%;
    max-width: 100%;
  }

  .mcard-back-grid {
    grid-template-columns: 1fr;
  }

  .mcard-field {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .mcard-field label,
  .mcard-field-label { white-space: normal; }

  .mcard-split { grid-template-columns: 1fr; }

  .enroll-idcard-upload {
    width: 100%;
    justify-content: center;
    border-radius: 12px;
  }

  .enroll-idcard-upload input { max-width: 100%; }
}

@media print {
  body * { visibility: hidden !important; }
  .membership-deck,
  .membership-deck * { visibility: visible !important; }
  .membership-deck {
    position: absolute;
    inset: 0;
    max-width: none;
    gap: 8mm;
    padding: 6mm;
  }
  .mcard {
    break-inside: avoid;
    box-shadow: none;
  }
}
