/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius-pill);
  padding: 16px 32px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
  background: var(--yellow);
  color: var(--black);
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(255, 212, 0, 0.25);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black);
}

.btn-outline {
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline:hover {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow);
}

.btn-block { width: 100%; }

/* ---------- Offset-stack card ---------- */

/* Flex column so .stack-card-btn/.stack-card-face can stretch to fill the
   grid row height (grid items stretch by default) — otherwise a card with
   a shorter summary ends up visibly shorter than its row siblings. */
.stack-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 16px;
  padding-right: 16px;
}

.stack-card::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 16px;
  right: 0;
  bottom: -16px;
  border-radius: var(--radius-card);
  border: 3px solid var(--white-soft);
  background: var(--black);
  z-index: 0;
}

.stack-card-face {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-card);
  border: 3px solid var(--white-soft);
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.stack-card:hover .stack-card-face,
.stack-card:focus-within .stack-card-face {
  transform: translateY(-8px);
  border-color: var(--yellow);
  box-shadow: 0 8px 32px rgba(255, 212, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stack-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--card-face);
}

.stack-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  background: var(--black);
  color: var(--yellow);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stack-card-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .stack-card-badge::before { animation: none; }
}

.stack-card-media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, var(--card-face), var(--card-face) 12px, #eaeff6 12px, #eaeff6 24px);
}

.stack-card-media-empty .stack-card-badge {
  position: static;
}

.stack-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transform-origin: bottom;
  transition: filter 0.5s ease, transform 0.5s ease;
}

.stack-card:hover .stack-card-media img,
.stack-card:focus-within .stack-card-media img {
  filter: grayscale(0);
  transform: scale(1.15);
}

.stack-card-bar {
  background: var(--card-bar);
  padding: 10px 20px;
  transition: background 0.4s ease;
}

.stack-card:hover .stack-card-bar,
.stack-card:focus-within .stack-card-bar {
  background: var(--yellow);
}

.stack-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  color: var(--black);
  margin: 0;
}

.stack-card-body {
  flex: 1;
  padding: 20px;
  color: var(--black);
}

.stack-card-meta {
  font-size: 13px;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.stack-card-summary {
  font-size: 15px;
  line-height: 150%;
  margin: 0;
}

.stack-card-btn {
  all: unset;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  cursor: pointer;
}

/* ---------- Flip card (team) ---------- */

/* .flip-card is a <button>: reset the UA background/border/padding or the
   default light button chrome shows as a pale slab behind the card. */
.flip-card {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  flex: 0 0 auto;
  width: 240px;
  max-width: 100%;
  height: 360px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
  border-radius: var(--radius-card);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* backface-visibility must sit on the painted element itself, not just the
   wrapper, or the white back face bleeds out behind the dark front face. */
.flip-card-front, .flip-card-back,
.flip-card-front-content, .flip-card-back-content {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
}

.flip-card-front { z-index: 2; }
.flip-card-back { transform: rotateY(180deg); z-index: 1; }

/* Front face (default visible): dark card with illustrated avatar */
.flip-card-front-content {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  border: 4px solid var(--white-soft);
  background: var(--black);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
}

.flip-card:hover .flip-card-front-content {
  border-color: var(--yellow);
  box-shadow: 0 0 20px rgba(255, 212, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-8px);
}

.flip-card-avatar {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.flip-card-name-small {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--white);
  margin: 16px 0 0;
  text-align: center;
}

.flip-card-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: rgba(229, 229, 229, 0.5);
  transition: opacity 0.2s ease;
}

.flip-card:hover .flip-card-hint { opacity: 1; }

/* Back face (shown after click): white detail card */
.flip-card-back-content {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* transform: translateZ(0) gives this its own compositing layer. Without it,
   Chrome fails to route wheel/touch scroll to an overflow:auto element that
   sits inside a preserve-3d + backface-visibility:hidden ancestor (the flip
   card) — it scrolls fine via scrollTop but ignores the mouse wheel. */
.flip-card-back-inner {
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  margin: 8px;
  border-radius: 12px;
  background: var(--card-face);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
}

/* Photo fills the visible card on flip; name/role/bio sit below and need a
   scroll to reach, per request: "foto full waktu flip, tapi bisa discroll". */
/* Fixed height matches landing's flip-card-photo (224px), not stretched to
   fill the card; .flip-card-back-inner scrolls if info below runs long. */
.flip-card-photo {
  position: relative;
  flex-shrink: 0;
  height: 224px;
  overflow: hidden;
  background: var(--card-face);
}

.flip-card-photo img { width: 100%; height: 100%; object-fit: cover; }

.flip-card-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(19, 19, 19, 0.7);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  animation: hint-bob 1.6s ease-in-out infinite;
}

@keyframes hint-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .flip-card-scroll-hint { animation: none; }
}

.flip-card-info {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  text-align: left;
  background: var(--card-face);
}

.flip-card-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  line-height: 120%;
  color: var(--black);
  margin: 0;
}

.flip-card-nickname {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  line-height: 120%;
  color: var(--black);
  margin: 0;
}

.flip-card-nickname strong { font-weight: 800; }

.flip-card-role {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 130%;
  color: var(--grey);
  margin: 4px 0 0;
}

.flip-card-bio {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 150%;
  color: var(--black);
  margin: 0;
}

/* ---------- Form ---------- */

.form-panel {
  border-radius: var(--radius-card);
  border: 3px solid rgba(229, 229, 229, 0.2);
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
}

@media (min-width: 640px) { .form-panel { padding: 40px; } }

.form-row { margin-bottom: 20px; }

.form-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(229, 229, 229, 0.7);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border-radius: var(--radius-input);
  border: 2px solid rgba(229, 229, 229, 0.2);
  background: transparent;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 16px;
  transition: border-color 0.3s ease;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23e5e5e5'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.19l3.71-3.96a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-select option { background: var(--black); color: var(--white); }

.form-textarea { resize: vertical; min-height: 120px; }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--yellow);
}

.form-error {
  display: none;
  color: var(--yellow);
  font-size: 13px;
  margin-top: 6px;
}

.form-row.has-error .form-error { display: block; }

.form-row.has-error .form-input,
.form-row.has-error .form-select,
.form-row.has-error .form-textarea {
  border-color: #ff6b6b;
}

.form-status {
  margin-top: 16px;
  font-size: 14px;
  color: var(--white-soft);
}

/* ---------- Working model toggle ---------- */

.toggle-group {
  display: inline-flex;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(229, 229, 229, 0.2);
  padding: 4px;
  gap: 4px;
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--white-soft);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background 0.3s ease, color 0.3s ease;
}

.toggle-btn[aria-selected="true"] {
  background: var(--yellow);
  color: var(--black);
}

.model-panel { display: none; }
.model-panel.is-active { display: block; }

/* comparison table */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 32px;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid rgba(229, 229, 229, 0.15);
  font-size: 15px;
}

.compare-table th {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--white-soft);
}

.compare-table td:not(:first-child),
.compare-table th:not(:first-child) {
  text-align: center;
  width: 25%;
}

.compare-icon-yes { color: var(--yellow); font-weight: 700; }
.compare-icon-no { color: var(--muted-dim); }

.compare-cards { display: none; }

@media (max-width: 767px) {
  .compare-table { display: none; }
  .compare-cards { display: grid; gap: 16px; margin-top: 32px; }
  .compare-card {
    border: 2px solid rgba(229, 229, 229, 0.2);
    border-radius: var(--radius-card);
    padding: 20px;
  }
  .compare-card h4 {
    font-family: var(--font-display);
    font-size: 16px;
    text-transform: uppercase;
    margin: 0 0 12px;
  }
  .compare-card ul li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(229, 229, 229, 0.1);
    font-size: 14px;
  }
}

/* package cards */

.package-grid {
  display: grid;
  gap: 24px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .package-grid { grid-template-columns: repeat(3, 1fr); }
}

.package-card {
  border: 2px solid rgba(229, 229, 229, 0.2);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.package-card:hover { border-color: var(--yellow); transform: translateY(-4px); }

.package-card-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.package-card-tag {
  font-size: 13px;
  color: var(--yellow);
  margin: 0 0 20px;
}

.package-card ul {
  margin-bottom: 24px;
  flex-grow: 1;
}

.package-card li {
  font-size: 14px;
  padding: 6px 0;
  color: var(--white-soft);
}

.package-card li::before { content: '✓ '; color: var(--yellow); }

/* diagram flow */

.flow-diagram {
  margin-top: 40px;
  width: 100%;
  overflow-x: auto;
}

.flow-diagram svg {
  display: block;
  min-width: 560px;
  width: 100%;
  max-width: 1000px;
  height: auto;
  margin: 0 auto;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop.is-open { display: flex; }

.modal-panel {
  background: var(--black);
  border: 2px solid var(--yellow);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: modalPop 0.3s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 24px;
  line-height: 1;
  padding: 8px;
}

.modal-close:hover { color: var(--yellow); }

.modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  margin: 0 0 4px;
  padding-right: 32px;
}

.modal-meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.modal-section-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--yellow);
  margin: 20px 0 8px;
}

.modal-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.modal-result-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--yellow);
}

.modal-result-label {
  font-size: 12px;
  color: var(--muted);
}

.modal-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.modal-stack span {
  border: 1px solid rgba(229, 229, 229, 0.3);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12px;
}

.modal-quote {
  margin: 20px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--yellow);
  font-style: italic;
  color: var(--white-soft);
}

.modal-quote footer {
  margin-top: 8px;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}
