/* Paleta */
:root {
  --primary: var(--burgundy);
  --lilac: #e3e2df; /* base clara (cinza quente da paleta) */
  --lilac-2: #e3afbc; /* rosa claro da paleta */
  --cream: #e3e2df; /* seções alternadas agora usando a base clara */
  --ink: #5d001e; /* texto principal (vinho escuro da paleta) */
  --muted: #9a1750; /* texto secundário (magenta escuro) */
  --burgundy: #9a1750; /* destaque/botões */
  --burgundy-2: #5d001e; /* hover/dark */
  --white: #fff;
  --bg: var(--lilac);
  --card: var(--white);
  --ring: rgba(0, 0, 0, 0.06);
  --ring-strong: rgba(0, 0, 0, 0.12);
  --radius-2: 0;
  --radius-3: 0;
}

/* Base */
* {
  box-sizing: border-box;
}
body {
  font-family: Inter, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  background-image: url("../images/wallpaperskintone.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat !important;
}

/* Progress */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(253, 249, 245, 0.4);
  backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
}
.bar {
  flex: 1;
  height: 10px;
  background: rgba(239, 231, 223, 0.6);
  border-radius: 0;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--burgundy), var(--lilac-2));
  transition: 0.3s;
}
.pct {
  min-width: 50px;
  text-align: right;
  color: var(--primary);
  font-weight: 600;
}

/* Layout */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 16px 16px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.hero {
  text-align: center;
  margin-bottom: 16px;
}
.title {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  color: var(--primary);
  margin: 0;
}
.subtitle {
  color: var(--muted);
}

/* Pages */
.page {
  display: block;
}
.page.is-hidden {
  display: none;
}

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--ring);
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  flex: 1;
  overflow-y: auto;
}
.grid {
  display: grid;
  gap: 20px;
}

/* Questões */
.q {
  border: 1px solid var(--ring);
  border-radius: 0;
  padding: 12px;
}
.q legend {
  font-family: "Playfair Display", serif;
  color: var(--primary-600);
  margin-bottom: 8px;
}
.choice {
  display: block;
  padding: 8px;
  border-radius: 0;
  cursor: pointer;
}
.choice:hover {
  background: color-mix(in oklab, var(--lilac), white 90%);
}
input[type="radio"]:checked + .choice {
  background: var(--lilac-2);
  border: 1px solid var(--burgundy);
}
input[type="radio"] {
  margin-right: 8px;
}

/* Actions */
.actions {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.actions-left {
  display: flex;
  gap: 12px;
  min-width: 0;
  flex: 0.6;
}
.actions-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.actions-right {
  display: flex;
  gap: 12px;
  min-width: 0;
  flex: 0.4;
  justify-content: flex-end;
}
button {
  padding: 10px 18px;
  border-radius: 0;
  cursor: pointer;
  font-weight: 600;
  border: 1.5px solid transparent;
  white-space: nowrap;
  min-width: fit-content;
}
.primary {
  background: var(--burgundy);
  color: var(--white);
  border-color: var(--burgundy);
}
.primary:disabled {
  background: color-mix(in oklab, var(--burgundy), white 60%);
  cursor: not-allowed;
  border-color: color-mix(in oklab, var(--burgundy), white 60%);
}
.ghost {
  background: var(--white);
  border: 1.5px solid var(--ring);
  color: var(--burgundy);
}

/* Toast */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #fff;
  border: 1px solid var(--ring);
  border-radius: 0;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: none;
}
.toast.show {
  display: block;
}

/* Result Modal */
.result-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: clamp(10px, 2.2vh, 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.result-modal.show {
  display: flex;
}
.result-content {
  background: #fff;
  border-radius: 0;
  padding: clamp(18px, 2vw + 8px, 30px);
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(154, 23, 80, 0.35) transparent;
}
.result-content::-webkit-scrollbar {
  width: 6px;
}
.result-content::-webkit-scrollbar-track {
  background: transparent;
}
.result-content::-webkit-scrollbar-thumb {
  background: rgba(154, 23, 80, 0.35);
  border-radius: 0;
}
.result-content::-webkit-scrollbar-thumb:hover {
  background: rgba(154, 23, 80, 0.5);
}
.result-title {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 12px;
}
.result-description {
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 16px;
}
.result-characteristics {
  background: var(--lilac);
  border-radius: 0;
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
}
.result-characteristics h4 {
  color: var(--primary);
  margin-bottom: 8px;
  font-family: "Playfair Display", serif;
}
.result-characteristics ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.result-characteristics li {
  padding: 2px 0;
  color: var(--ink);
}
.result-characteristics li:before {
  content: "✓";
  color: var(--burgundy);
  font-weight: bold;
  margin-right: 8px;
}
.result-recommendations {
  background: color-mix(in oklab, var(--lilac-2), white 90%);
  border-radius: 0;
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
}
.result-recommendations h4 {
  color: var(--primary);
  margin-bottom: 8px;
  font-family: "Playfair Display", serif;
}
.result-recommendations ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.result-recommendations li {
  padding: 2px 0;
  color: var(--ink);
}
.result-recommendations li:before {
  content: "💡";
  margin-right: 8px;
}
.result-button {
  background: var(--burgundy);
  color: #fff;
  padding: 12px 24px;
  border-radius: 0;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: background 0.3s;
}
.result-button:hover {
  background: var(--burgundy-2);
}

@media (max-width: 640px) {
  .result-modal {
    padding: 12px;
  }
  .result-content {
    border-radius: 0;
    padding: 18px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .result-title {
    font-size: clamp(22px, 7vw, 26px);
    margin-bottom: 12px;
  }
  .result-description {
    line-height: 1.45;
    margin-bottom: 16px;
  }
  .result-characteristics,
  .result-recommendations,
  .result-colors {
    padding: 12px;
    margin-bottom: 16px;
  }
  .result-characteristics h4,
  .result-recommendations h4,
  .result-colors h4 {
    margin-bottom: 8px;
  }
  .result-characteristics li,
  .result-recommendations li,
  .result-colors li {
    padding: 2px 0;
  }
  .result-button {
    display: block;
    width: 100%;
    padding: 11px 18px;
  }
}

@media (max-height: 740px) {
  .result-modal {
    align-items: flex-start;
  }
  .result-content {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 16px;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .result-title {
    margin-bottom: 10px;
  }
  .result-description {
    margin-bottom: 12px;
  }
  .result-characteristics,
  .result-recommendations,
  .result-colors {
    margin-bottom: 12px;
  }
}

/* Fixed Back Button */
.back-button {
  position: fixed;
  top: 80px;
  left: 20px;
  background-color: var(--burgundy);
  color: var(--white);
  border-radius: 0;
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
  gap: 6px;
}

.back-button:hover {
  background-color: var(--burgundy-2);
}

/* Custom SweetAlert Styles */
.swal-popup {
  border-radius: 0 !important;
  border: 1px solid var(--ring) !important;
}

.swal-title {
  font-family: "Playfair Display", serif !important;
  color: var(--primary) !important;
}

.swal-text {
  font-family: "Inter", sans-serif !important;
  color: var(--muted) !important;
}
