/* ---------- Banner ---------- */

.mastery-banner {
  background: var(--dark);
  color: #ffffff;
  padding: 160px clamp(20px, 5vw, 120px) 80px;
}
.mastery-banner--short { padding: 160px clamp(20px, 5vw, 120px) 100px; min-height: 60vh; display: flex; align-items: center; }
.mastery-banner-title {
  color: #ffffff;
  max-width: 820px;
  margin: 0 0 20px;
}
.mastery-banner-subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
  margin: 0;
}
.thank-you-wrap { max-width: 720px; }
.thank-you-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 40px; }
.link-underline-dark {
  color: #0a0a0a; text-decoration: none; font-size: 15px; font-weight: 500;
  border-bottom: 1px solid #ccc; padding-bottom: 4px; transition: color .2s ease, border-color .2s ease;
}
.link-underline-dark:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Thank-you page (light) ---------- */

.ty-section { background: #f6f6f4; padding: 150px clamp(20px, 5vw, 120px) 120px; }
.ty-wrap { max-width: 620px; text-align: center; }

.ty-check {
  width: 56px; height: 56px; margin: 0 auto 24px; border-radius: 50%;
  background: #1e7a34; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ty-section .eyebrow { margin-bottom: 12px; }
.ty-title {
  font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.2; color: #0a0a0a; margin: 0 0 12px;
}
.ty-class-name { font-size: 15.5px; color: #555; margin: 0 0 8px; }
.ty-class-name strong { color: #0a0a0a; }
.ty-subtitle { font-size: 15.5px; line-height: 1.6; color: #777; margin: 0; }
.ty-section .thank-you-actions { justify-content: center; }

.ty-card {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 28px clamp(18px, 5vw, 36px) 32px;
  margin-top: 36px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(10,10,10,0.06);
}
.ty-card-header { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.ty-card-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(232,86,58,0.1); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.ty-card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: #0a0a0a; }
.ty-card-subtitle { font-size: 13px; color: #888; margin-top: 2px; }

.ty-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
.ty-table th, .ty-table td {
  padding: 15px 6px; border-bottom: 1px solid #eee;
  text-align: center; vertical-align: middle;
}
.ty-table tr:last-child th, .ty-table tr:last-child td { border-bottom: none; }
.ty-table th {
  width: 42%; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: #999;
}
.ty-table td { font-size: 15.5px; font-weight: 600; color: #0a0a0a; word-break: break-word; }
.ty-table-amount-row { background: #fbf5f3; }
.ty-table-amount-row th { color: #b5493a; }
.ty-table-amount-row td { color: var(--accent); font-size: clamp(18px, 4vw, 22px); font-weight: 800; }

.ty-account-cell { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ty-copy-btn {
  flex: 0 0 auto;
  background: #0a0a0a; color: #fff; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.ty-copy-btn:hover { opacity: 0.85; }

.ty-note { font-size: 13.5px; line-height: 1.6; color: #666; margin: 0 0 20px; }
.ty-card .btn-whatsapp { width: 100%; text-align: center; }

@media (max-width: 640px) {
  .ty-section { padding-top: 120px; }
  .ty-card { padding: 24px 18px 26px; }
}

@media (max-width: 460px) {
  .ty-table, .ty-table tbody, .ty-table tr, .ty-table th, .ty-table td { display: block; width: 100%; }
  .ty-table tr { padding: 12px 0; border-bottom: 1px solid #eee; }
  .ty-table tr:last-child { border-bottom: none; }
  .ty-table th, .ty-table td { border-bottom: none; padding: 2px 0; }
  .ty-table-amount-row { padding: 12px 0; border-radius: 8px; }
}

/* ---------- Class list ---------- */

.mastery-list { background: #f6f6f4; padding: 80px clamp(20px, 5vw, 120px) 140px; }

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 8px;
}

.class-card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #e6e6e6;
  transition: box-shadow .2s ease, transform .2s ease;
}
.class-card:hover { box-shadow: 0 12px 28px rgba(10,10,10,0.08); transform: translateY(-2px); }

/* Image is never cropped: shown whole (object-fit: contain) inside a fixed 4:5 box. */
.class-card-image {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  background: #eeece8;
  text-decoration: none;
}
.class-card-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.class-card-image-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, #0a0a0a, var(--accent));
  font-size: 20px; font-weight: 700; text-align: center; padding: 24px;
}

.class-status-pill {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 20px;
  color: #fff;
}
.class-status-pill.is-open { background: #1e7a34; }
.class-status-pill.is-sold-out { background: var(--accent); }

/* Overlay positioning only when the pill sits on top of a card thumbnail. */
.class-card-image .class-status-pill { position: absolute; top: 14px; right: 14px; }

.class-type-pill {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 20px;
  background: #eeece8; color: #444;
}

.class-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.class-card-title { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -0.01em; line-height: 1.3; }
.class-card-title a { color: inherit; text-decoration: none; }
.class-card-title a:hover { color: var(--accent); }

.class-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: #444; }
.class-meta li { display: flex; align-items: flex-start; gap: 9px; line-height: 1.4; }
.class-meta li svg { flex: 0 0 auto; margin-top: 1px; color: var(--accent); }
.class-map-link { display: inline-block; font-size: 13px; color: var(--accent); text-decoration: none; }
.class-map-link:hover { text-decoration: underline; }

.btn-dark-outline {
  margin-top: auto;
  display: inline-block;
  background: #0a0a0a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 2px;
  border: 1px solid #0a0a0a;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  transition: opacity .2s ease;
  width: 100%;
}
.btn-dark-outline:hover { opacity: 0.85; }
.btn-dark-outline:disabled {
  background: #eee; color: #999; border-color: #eee; cursor: not-allowed;
}

.btn.is-loading, .btn-dark-outline.is-loading {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: wait; opacity: 0.85;
}
.btn-dark-outline.is-loading:disabled {
  background: #0a0a0a; color: #ffffff; border-color: #0a0a0a;
}
.btn-spinner {
  width: 15px; height: 15px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: btn-spinner-spin .7s linear infinite;
}
@keyframes btn-spinner-spin { to { transform: rotate(360deg); } }

.btn-whatsapp {
  display: inline-block;
  background: #25D366;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 2px;
  border: 1px solid #25D366;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  transition: opacity .2s ease;
  width: 100%;
}
.btn-whatsapp:hover { opacity: 0.88; }

.empty-state { color: #888; font-size: 15px; padding: 40px 0; text-align: center; }

/* ---------- Class detail page ---------- */

.class-detail { background: #f6f6f4; padding: 160px clamp(20px, 5vw, 120px) 120px; }
.class-detail-back {
  display: inline-block; margin-bottom: 24px;
  font-size: 14px; font-weight: 600; color: #555; text-decoration: none;
}
.class-detail-back:hover { color: var(--accent); }

.class-detail-head { display: flex; gap: 10px; margin-bottom: 16px; }
.class-detail-title {
  font-size: clamp(26px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.15; margin: 0 0 32px; max-width: 900px;
}

.class-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }

.class-detail-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 640px;
  background: #eeece8;
  border-radius: 10px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.class-detail-image img { width: 100%; height: 100%; object-fit: contain; display: block; }

.class-detail-desc { margin-top: 32px; }
.class-detail-desc h2 { font-size: 20px; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.01em; }
.class-detail-desc-content { font-size: 15.5px; line-height: 1.75; color: #3a3a3a; word-wrap: break-word; white-space: pre-wrap; }
.class-detail-desc-content p, .class-detail-desc-content div { margin: 0 0 12px; }
.class-detail-desc-content p:last-child, .class-detail-desc-content div:last-child { margin-bottom: 0; }

.class-detail-sidebar { position: sticky; top: 100px; }
.class-info-card {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 22px;
}
.class-info-row { display: flex; gap: 12px; align-items: flex-start; }
.class-info-row svg { flex: 0 0 auto; margin-top: 3px; color: var(--accent); }
.class-info-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #999; margin-bottom: 4px; }
.class-info-value { font-size: 14.5px; line-height: 1.5; color: #222; }

.class-info-actions { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid #eee; margin-top: 2px; padding-top: 20px; }

/* ---------- Registration modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,10,10,0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }

.modal-panel {
  position: relative;
  background: #ffffff;
  border-radius: 10px;
  padding: 40px clamp(20px, 4vw, 44px) 44px;
  width: 100%;
  max-width: 620px;
  margin: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: #f2f2f0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}
.modal-close:hover { background: #e6e6e6; }
.modal-title { font-size: 22px; font-weight: 700; margin: 0 0 24px; letter-spacing: -0.01em; padding-right: 40px; }

.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-form .field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.modal-form .field-row .field { flex: 1 1 200px; }
.modal-form .field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #333; }
.modal-form input,
.modal-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14.5px;
  font-family: inherit;
  color: #0a0a0a;
  background: #fff;
}
.modal-form textarea { resize: vertical; }
.modal-form input:focus, .modal-form textarea:focus { outline: none; border-color: var(--accent); }
.modal-form .btn { margin-top: 8px; width: 100%; text-align: center; background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
.modal-form .btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal-form-error { color: #b3261e; font-size: 13.5px; }

.field-hint { font-size: 12.5px; color: #888; line-height: 1.5; margin: -2px 0 10px; }
.participant-group:not(:empty) { margin-bottom: 10px; }
.participant-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.participant-row input { flex: 1 1 0; min-width: 0; }
.participant-row-remove {
  flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid #ddd; border-radius: 6px;
  background: #fff; color: #999; font-size: 18px; line-height: 1; cursor: pointer; font-family: inherit;
}
.participant-row-remove:hover { color: #b3261e; border-color: #b3261e; }
.btn-add-participant {
  width: 100%; padding: 10px; border: 1px dashed #ccc; border-radius: 6px; background: #fff;
  color: #555; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-add-participant:hover { border-color: var(--accent); color: var(--accent); }

body.modal-open { overflow: hidden; }

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
  .class-detail-grid { grid-template-columns: 1fr; }
  .class-detail-sidebar { position: static; }
  .class-detail-image { max-height: 480px; }
}

@media (max-width: 640px) {
  .class-grid { grid-template-columns: 1fr; }
  .mastery-banner, .mastery-banner--short { padding-top: 130px; }
  .class-detail { padding-top: 130px; }
  .modal-panel { padding: 32px 20px 32px; }
}
