/**
 * Theme picker - phone-proportioned miniature card layout mockups.
 * Aspect ratio matches the live preview mockup (320 × 580).
 */

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.theme-picker__option {
  position: relative;
  cursor: pointer;
  display: block;
}

.theme-picker__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-picker__card {
  border: 2px solid var(--site-border, #e0e0e0);
  border-radius: 10px;
  padding: 14px 10px 10px;
  text-align: center;
  background: var(--site-surface, #ffffff);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.theme-picker__option:hover .theme-picker__card,
.theme-picker__option.is-active .theme-picker__card,
.theme-picker__option input:checked + .theme-picker__card {
  border-color: var(--site-accent, #009fd8);
  background: var(--site-accent-tint, #f0f9ff);
  box-shadow: 0 0 0 1px rgba(0, 159, 216, 0.15);
}

.theme-picker__name {
  font-size: 11px;
  font-weight: 700;
  color: var(--site-fg, #333333);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
  width: 100%;
}

/* ---------------------------------------------------------------- phone shell */
[data-theme-picker] {
  --tp-primary: #009fd8;
  --tp-secondary: #0088bb;
  --tp-font: 'Montserrat', sans-serif;
}

.theme-mockup {
  --tp-phone-w: 108px;
  width: var(--tp-phone-w);
  max-width: 100%;
  aspect-ratio: 320 / 580;
  height: auto;
  margin: 0 auto 10px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 2px #1a1a1a,
    0 8px 20px rgba(0, 0, 0, 0.18);
  background: #ffffff;
  font-family: var(--tp-font);
  flex-shrink: 0;
}

.tm-line {
  height: 3px;
  border-radius: 2px;
  background: #d8d8d8;
  width: 100%;
  flex-shrink: 0;
}

.tm-line--short {
  width: 58%;
  margin-inline: auto;
}

.tm-line--light {
  background: rgba(255, 255, 255, 0.78);
}

.tm-text {
  font-size: 6.5px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  font-family: var(--tp-font);
  flex-shrink: 0;
}

.tm-text--name {
  color: #444444;
}

.tm-text--light {
  color: rgba(255, 255, 255, 0.95);
}

.tm-text--accent {
  color: var(--tp-primary);
}

.tm-btn {
  height: 7px;
  border-radius: 999px;
  background: var(--tp-primary);
  width: 68%;
  margin: 5px auto 0;
  flex-shrink: 0;
}

/* Profile photo placeholder icon */
.tm-avatar,
.tm-photo,
.tm-halo-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tm-profile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #9aa3ad;
  pointer-events: none;
}

.tm-profile-icon svg {
  width: 52%;
  height: 52%;
}

.theme-mockup--modern .tm-photo .tm-profile-icon {
  color: #8a929c;
}

.theme-mockup--classic .tm-photo .tm-profile-icon {
  color: rgba(255, 255, 255, 0.88);
}

.theme-mockup--classic .tm-photo .tm-profile-icon svg circle {
  fill: rgba(255, 255, 255, 0.88);
}

.theme-mockup--classic .tm-photo .tm-profile-icon svg path {
  stroke: rgba(255, 255, 255, 0.88);
}

.theme-mockup--corporate .tm-avatar .tm-profile-icon {
  color: var(--tp-primary);
}

.theme-mockup--creative .tm-avatar .tm-profile-icon {
  color: var(--tp-primary);
}

.tm-line--short.tm-line--left {
  width: 58%;
  margin-inline: 0;
}

.tm-text--left {
  text-align: left;
  width: 100%;
}

/* Stockholm - avatar + name inside gradient header */
.theme-mockup--stockholm {
  display: flex;
  flex-direction: column;
}

.theme-mockup--stockholm .tm-header {
  height: 38%;
  background: linear-gradient(135deg, var(--tp-primary) 0%, var(--tp-secondary) 100%);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10% 12% 8%;
  gap: 4px;
}

.theme-mockup--stockholm .tm-avatar {
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  margin: 0;
}

.theme-mockup--stockholm .tm-body {
  flex: 1;
  padding: 10% 16% 14%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
}

.theme-mockup--stockholm .tm-text--name {
  text-align: center;
  font-size: 7px;
  margin: 0;
}

/* Quito - full-height gradient, large halo avatar */
.theme-mockup--quito {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, var(--tp-primary) 0%, var(--tp-secondary) 100%);
}

.theme-mockup--quito .tm-halo {
  width: 42%;
  aspect-ratio: 1;
  margin-top: 11%;
  padding: 6%;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--tp-primary), var(--tp-secondary));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.theme-mockup--quito .tm-halo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.theme-mockup--quito .tm-text--name {
  margin-top: 5%;
  text-align: center;
  font-size: 7px;
}

.theme-mockup--quito .tm-panel {
  margin-top: auto;
  width: 100%;
  padding: 8% 16% 12%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
}

/* Jakarta - banner + horizontal business card */
.theme-mockup--modern {
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
}

.theme-mockup--modern .tm-banner {
  height: 14%;
  background: linear-gradient(180deg, var(--tp-primary) 0%, color-mix(in srgb, var(--tp-primary) 72%, #000000) 100%);
  flex-shrink: 0;
}

.theme-mockup--modern .tm-bizcard {
  display: flex;
  width: 84%;
  height: 21%;
  margin: -6% auto 0;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.theme-mockup--modern .tm-photo {
  width: 40%;
  background: #c8c8c8;
}

.theme-mockup--modern .tm-info {
  flex: 1;
  background: linear-gradient(135deg, var(--tp-primary) 0%, var(--tp-secondary) 100%);
  padding: 10% 8%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.theme-mockup--modern .tm-info .tm-text--name {
  font-size: 6px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-mockup--modern .tm-body {
  flex: 1;
  padding: 10% 16% 14%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: flex-start;
}

/* Ottawa - large photo, coloured lower panel */
.theme-mockup--classic {
  display: flex;
  flex-direction: column;
}

.theme-mockup--classic .tm-photo {
  height: 58%;
  background: #b8b8b8;
  position: relative;
  flex-shrink: 0;
}

.theme-mockup--classic .tm-photo::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(to top, var(--tp-secondary), transparent);
}

.theme-mockup--classic .tm-lower {
  flex: 1;
  background: var(--tp-secondary);
  padding: 8% 14% 12%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
}

.theme-mockup--classic .tm-text--name {
  font-size: 7px;
  margin-bottom: 2px;
  text-align: left;
}

.theme-mockup--classic .tm-line--short {
  margin-inline: 0;
}

/* London - name in header, overlapping avatar, all-primary body */
.theme-mockup--corporate {
  display: flex;
  flex-direction: column;
  background: var(--tp-primary);
}

.theme-mockup--corporate .tm-header {
  height: 30%;
  min-height: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--tp-secondary) 78%, #000000) 0%,
    var(--tp-secondary) 55%,
    color-mix(in srgb, var(--tp-secondary) 82%, #ffffff) 100%
  );
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10% 10% 0;
  position: relative;
  z-index: 1;
}

.theme-mockup--corporate .tm-header .tm-text--name {
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  width: 100%;
}

.theme-mockup--corporate .tm-avatar {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--tp-primary);
  margin: 0;
  z-index: 4;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-mockup--corporate .tm-primary-area {
  flex: 1;
  background: var(--tp-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  padding-top: 22%;
}

.theme-mockup--corporate .tm-content {
  flex: 1;
  background: transparent;
  padding: 4% 16% 12%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: flex-start;
}

/* Hanoi - offset avatar, accent name, soft background */
.theme-mockup--creative {
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--tp-secondary) 18%, #ffffff) 0%,
    #f3f3f7 100%
  );
}

.theme-mockup--creative .tm-avatar {
  position: absolute;
  top: 4%;
  right: -6%;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.theme-mockup--creative .tm-text--overlap {
  position: absolute;
  left: 16%;
  top: 12%;
  max-width: 68%;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.05;
  z-index: 3;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9), 0 0 6px rgba(255, 255, 255, 0.6);
}

.theme-mockup--creative .tm-meta {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 14%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

@media (max-width: 968px) {
  .theme-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-mockup {
    --tp-phone-w: 118px;
  }
}

@media (max-width: 480px) {
  .theme-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .theme-mockup {
    --tp-phone-w: 100px;
  }
}

@media (min-width: 1100px) {
  .theme-mockup {
    --tp-phone-w: 112px;
  }
}
