:root {
  --cream: #FAF4EB;
  --cream-dark: #F2E7D5;
  --ink: #211a21;
  --white: #ffffff;
  --purple: #551B52;
  --purple-dark: #370e35;
  --purple-light: #6d2469;
  --gold: #D4AF37;
  --gold-bright: #F6E27A;
  --gold-dark: #9A7B1C;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --serif: "Cinzel", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #682264 0%, #3e123c 55%, #1d071e 100%);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.frame {
  max-width: 580px;
  margin: 0 auto;
  padding: 24px 16px 50px;
}

/* Brand Header */
.brand {
  text-align: center;
  padding: 6px 0 20px;
}
.logo-ring {
  width: 104px;
  height: 104px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #ffffff;
  padding: 4px;
  border: 2.5px solid var(--gold);
  box-shadow: 0 0 24px var(--gold-glow), 0 8px 18px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.logo-ring:hover {
  transform: scale(1.03);
}
.logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.brand-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  line-height: 1.2;
}
.brand-tagline {
  font-size: 0.82rem;
  color: #eedcf0;
  margin-top: 4px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.1) 100%);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-top: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Main Card */
.card {
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 26px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-bright), var(--gold-dark));
}

.section-head {
  text-align: center;
  margin-bottom: 20px;
}
h1, h2 {
  font-family: var(--serif);
  color: var(--purple-dark);
  margin: 0 0 0.4em;
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: 1.65rem; }
h2 { font-size: 1.35rem; }

.lead {
  font-size: 0.96rem;
  color: #3b2c3a;
  line-height: 1.5;
}
.muted {
  color: #635762;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Step Input Groups */
.input-group {
  margin-bottom: 22px;
}
.group-title {
  display: block;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--purple-dark);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple);
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
}
.group-sub {
  font-size: 0.8rem;
  color: #7a6e79;
  font-weight: 400;
}

/* 1. Star Rating Component */
.star-rating-box {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0;
  padding: 10px;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}
.star-btn {
  background: transparent;
  border: none;
  font-size: 2.35rem;
  color: #d1c7bc;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: transform 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.star-btn.active {
  color: #E5A912;
  text-shadow: 0 0 10px rgba(229, 169, 18, 0.45);
}
.star-btn:hover {
  transform: scale(1.18);
}
.rating-feedback-badge {
  text-align: center;
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--purple-dark);
  background: rgba(212, 175, 55, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

/* 2. Interactive Choice Chips Grid */
.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
@media (max-width: 420px) {
  .chips-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
}

.choice-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  background: #ffffff;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.choice-chip:hover {
  border-color: var(--gold);
  background: #fdfaf4;
}
.choice-chip.selected {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  border-color: var(--gold);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(85, 27, 82, 0.35), inset 0 0 0 1px var(--gold);
  transform: translateY(-1px);
}
.chip-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
}
.chip-text {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}
.chip-text small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: #796e78;
  margin-top: 2px;
}
.choice-chip.selected .chip-text small {
  color: #eedaf0;
}

/* 3. Language Selector */
.lang-selector {
  display: flex;
  gap: 8px;
}
.lang-chip {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid var(--gold);
  background: #ffffff;
  border-radius: 20px;
  font: 600 0.9rem var(--sans);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
}
.lang-chip:hover { border-color: var(--purple); }
.lang-chip.active {
  background: var(--purple);
  color: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow: 0 3px 10px rgba(85, 27, 82, 0.35);
}

/* Text Inputs */
.text-input {
  width: 100%;
  padding: 11px 13px;
  font-size: 0.92rem;
  font-family: inherit;
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: all 0.2s;
}
.text-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35);
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font: 700 0.98rem var(--sans);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}
.btn.primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: var(--cream);
  border: 1.5px solid var(--gold);
  box-shadow: 0 4px 14px rgba(85, 27, 82, 0.35);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--purple-light) 0%, var(--purple) 100%);
  box-shadow: 0 6px 18px rgba(85, 27, 82, 0.5);
  transform: translateY(-1px);
}
.btn.gold-cta {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a0f02;
  border: 1.5px solid #8c6a08;
  font-weight: 700;
  box-shadow: 0 5px 18px rgba(212, 175, 55, 0.45);
}
.btn.gold-cta:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.65);
  transform: translateY(-1px);
}
.btn.outline {
  background: transparent;
  color: var(--purple-dark);
  border: 1.5px solid var(--purple);
}
.btn.outline:hover:not(:disabled) {
  background: rgba(85, 27, 82, 0.08);
}
.btn.link-btn {
  background: transparent;
  color: var(--purple);
  border: none;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 6px;
  min-height: auto;
}
.btn.back-link {
  background: transparent;
  color: #6e626e;
  border: none;
  font-size: 0.88rem;
  padding: 8px;
  min-height: auto;
  margin-top: 14px;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.main-gen-btn {
  font-size: 1.08rem;
  padding: 15px 20px;
  margin-top: 10px;
}
.hero-btn {
  font-size: 1.08rem;
  padding: 16px 20px;
  margin-top: 12px;
}

.secondary-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.flex-1 { flex: 1; }

.privacy-note {
  font-size: 0.78rem;
  color: #726671;
  text-align: center;
  margin-top: 14px;
  line-height: 1.4;
}

/* 4. Result Container */
.result-container {
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  text-align: center;
  margin-bottom: 16px;
}
.result-badge {
  display: inline-block;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.draft-wrapper {
  position: relative;
  margin-bottom: 14px;
}
.draft-box {
  width: 100%;
  padding: 14px 15px;
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.6;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
  resize: vertical;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
.draft-box:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35);
}
.char-hint {
  font-size: 0.78rem;
  color: #796f78;
  text-align: right;
  margin-top: 4px;
}

.toast {
  background: #14532d;
  color: #f0fdf4;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  margin: 12px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-msg {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 10px 0;
}

.private-box {
  background: #ffffff;
  border: 1px dashed rgba(212, 175, 55, 0.7);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 18px;
  text-align: center;
}
.private-text {
  font-size: 0.83rem;
  color: #635762;
  margin-bottom: 4px;
}

/* Thanks Box */
.thanks-container {
  text-align: center;
  padding: 20px 10px;
}
.thanks-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}
.note-card {
  background: #ffffff;
  border-left: 4px solid var(--gold);
  padding: 14px;
  margin-top: 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  color: #3b2c3a;
  text-align: left;
}

/* Social Footer */
.social-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.4);
}
.social-title {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--gold);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.social-link:hover {
  background: var(--gold);
  color: #1a0f02;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--gold-glow);
}
.social-link.whatsapp {
  border-color: #25D366;
}
.social-link.whatsapp:hover {
  background: #25D366;
  color: #ffffff;
  border-color: #25D366;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}

/* Gender Selector */
.gender-selector {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.gender-chip {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  background: #ffffff;
  border-radius: var(--radius);
  font: 600 0.88rem var(--sans);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.gender-chip:hover {
  border-color: var(--gold);
  background: #fdfaf4;
}
.gender-chip.active {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: 0 3px 10px rgba(85, 27, 82, 0.35);
}

/* Staff Grid & Card Styling */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 9px;
  margin-top: 8px;
}
@media (max-width: 480px) {
  .staff-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}
.staff-card {
  background: #ffffff;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.staff-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}
.staff-card.selected {
  background: linear-gradient(135deg, #fdf8ef 0%, #faedd9 100%);
  border: 2px solid var(--purple);
  box-shadow: 0 4px 14px rgba(85, 27, 82, 0.25), inset 0 0 0 1px var(--gold);
  transform: translateY(-2px);
}
.staff-avatar {
  width: 42px;
  height: 42px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.2);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.2s;
}
.staff-card.selected .staff-avatar {
  background: var(--purple);
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}
.staff-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--purple-dark);
  line-height: 1.2;
}
.staff-name small {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: #635762;
  margin-top: 2px;
}
.staff-role-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #7a5408;
  background: rgba(212, 175, 55, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
  margin-top: 4px;
}
.staff-card.selected .staff-role-badge {
  background: var(--purple);
  color: var(--gold-bright);
}

/* Staff Rating & Tags Box */
.staff-rate-box {
  background: #ffffff;
  border: 1px dashed rgba(212, 175, 55, 0.85);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
}
.staff-rate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--purple-dark);
  flex-wrap: wrap;
  gap: 6px;
}
.staff-star-row {
  display: flex;
  gap: 4px;
}
.staff-star-btn {
  background: none;
  border: none;
  font-size: 1.45rem;
  color: #d1c4d4;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  transition: transform 0.15s ease, color 0.15s ease;
}
.staff-star-btn.active {
  color: #E5A912;
  text-shadow: 0 0 8px rgba(229, 169, 18, 0.45);
}
.staff-star-btn:hover {
  transform: scale(1.2);
}
.staff-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.staff-tag-chip {
  font-size: 0.78rem;
  padding: 5px 11px;
  background: #fbf7f0;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 16px;
  cursor: pointer;
  color: #3b2c3a;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
}
.staff-tag-chip:hover {
  border-color: var(--gold);
  background: #fdfaf4;
}
.staff-tag-chip.selected {
  background: var(--purple);
  color: #ffffff;
  border-color: var(--gold);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(85, 27, 82, 0.25);
}

.copyright {
  color: #eeddf0;
  font-size: 0.78rem;
  margin-top: 16px;
  opacity: 0.85;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .frame { padding: 18px 12px 40px; }
  .card { padding: 20px 14px; }
  .star-btn { font-size: 2.1rem; padding: 2px; }
  .secondary-btn-row { flex-direction: column; }
}
