/* ============================================================
   AFFIRMATION ALCHEMIST PAGE
   Palette: brand blue #5c99ee, brand yellow #feb319, heading #344761
   ============================================================ */

/* Footer — match page background, no visible separator */
.affirmation-page .footer,
.affirmation-page .footer .footer-bottom {
  background-color: transparent;
  border-top: none;
}

/* Page wrapper — flexbox agar footer selalu menempel ke bawah konten */
.affirmation-page {
  background: #f8fbff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.affirmation-page .main {
  flex: 1;
}

/* Section */
.alchemist-section {
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
}

/* Floating orbs — biru & kuning brand, opacity sangat rendah agar halus */
.alchemist-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.28;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #bfdbfe, #93c5fd);
  top: -100px; left: -100px;
  animation-duration: 14s;
}
.orb-2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #fef3c7, #fde68a);
  top: 15%; right: -60px;
  animation-duration: 10s;
  animation-delay: -4s;
}
.orb-3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, #dbeafe, #bfdbfe);
  bottom: 12%; left: 10%;
  animation-duration: 16s;
  animation-delay: -7s;
}
.orb-4 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #fef9c3, #fef08a);
  bottom: 18%; right: 12%;
  animation-duration: 11s;
  animation-delay: -2s;
}
@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.08); }
}

/* Header */
.alchemist-header {
  text-align: center;
  position: relative;
  z-index: 1;
  margin-bottom: 40px;
}
.alchemist-icon-wrap {
  margin-bottom: 12px;
}
.alchemist-potion {
  font-size: 52px;
  display: inline-block;
  animation: potionFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 18px rgba(92, 153, 238, 0.35));
}
@keyframes potionFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%       { transform: translateY(-10px) rotate(5deg); }
}
.alchemist-title {
  font-family: 'Questrial', 'Open Sans', sans-serif;
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700;
  background: linear-gradient(135deg, #344761 0%, #5c99ee 60%, #4a7fd4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px;
  line-height: 1.2;
}
.alchemist-subtitle {
  font-size: clamp(14px, 2vw, 17px);
  color: #535d6b;
  margin: 0 0 20px;
  font-style: italic;
  letter-spacing: 0.03em;
}
.alchemist-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.alchemist-divider span {
  display: block;
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, #5c99ee, transparent);
}
.alchemist-divider .dot {
  width: auto;
  height: auto;
  background: none;
  color: #feb319;
  font-size: 14px;
}

/* Main card */
.alchemist-card {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(92, 153, 238, 0.18);
  box-shadow:
    0 4px 24px rgba(92, 153, 238, 0.10),
    0 1px 3px rgba(0,0,0,0.04);
  padding: 40px;
  overflow: hidden;
}
.alchemist-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(191,219,254,0.10) 0%, rgba(254,243,199,0.08) 100%);
  pointer-events: none;
}

/* Label */
.alchemist-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #344761;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.alchemist-label i { margin-right: 6px; color: #5c99ee; }

/* Textarea */
.alchemist-textarea-wrap {
  position: relative;
  margin-bottom: 24px;
}
.alchemist-textarea {
  width: 100%;
  border: 2px solid rgba(92, 153, 238, 0.3);
  border-radius: 16px;
  padding: 18px 20px 36px;
  font-size: 15px;
  font-family: 'Open Sans', sans-serif;
  line-height: 1.7;
  color: #344761;
  background: rgba(248, 251, 255, 0.8);
  resize: vertical;
  min-height: 140px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  outline: none;
}
.alchemist-textarea:focus {
  border-color: #5c99ee;
  box-shadow: 0 0 0 4px rgba(92, 153, 238, 0.12);
  background: #ffffff;
}
.alchemist-textarea::placeholder { color: #9ca3af; font-style: italic; }
.alchemist-char-count {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 11px;
  color: #9ca3af;
}

/* Transmutasi button — biru brand dengan glow kuning hover */
.alchemist-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 32px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #4a7fd4 0%, #5c99ee 60%, #74adf2 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Open Sans', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 20px rgba(92, 153, 238, 0.4);
}
.alchemist-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(92, 153, 238, 0.5),
    0 0 40px rgba(254, 179, 25, 0.3);
}
.alchemist-btn:active { transform: translateY(0); }
.btn-icon { font-size: 18px; animation: btnIconSpin 4s linear infinite; }
@keyframes btnIconSpin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%       { transform: rotate(15deg) scale(1.1); }
}
.btn-glow {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}
.alchemist-btn:hover .btn-glow { opacity: 1; }

/* Shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}
.alchemist-textarea.shake {
  animation: shake 0.4s ease;
  border-color: #ef4444 !important;
}

/* Loading state */
.alchemist-loading {
  text-align: center;
  padding: 20px 0 10px;
}
.potion-loader {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}
.potion-bottle {
  width: 48px;
  height: 64px;
  margin: 0 auto 8px;
  position: relative;
  background: linear-gradient(180deg, rgba(191,219,254,0.2) 0%, rgba(147,197,253,0.1) 100%);
  border-radius: 8px 8px 16px 16px;
  border: 2.5px solid rgba(92, 153, 238, 0.5);
  overflow: hidden;
  animation: bottleRock 1.2s ease-in-out infinite;
}
@keyframes bottleRock {
  0%, 100% { transform: rotate(-8deg); }
  50%       { transform: rotate(8deg); }
}
.potion-liquid {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(180deg, rgba(92,153,238,0.65), rgba(74,127,212,0.9));
  border-radius: 0 0 13px 13px;
  animation: liquidRise 2.5s ease-in-out infinite alternate;
}
@keyframes liquidRise {
  0%   { height: 40%; }
  100% { height: 70%; }
}
.potion-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  animation: bubbleUp 1.8s ease-in-out infinite;
}
.b1 { width: 6px; height: 6px; left: 30%; bottom: 10%; animation-delay: 0s; }
.b2 { width: 4px; height: 4px; left: 55%; bottom: 20%; animation-delay: 0.6s; }
.b3 { width: 5px; height: 5px; left: 45%; bottom: 5%;  animation-delay: 1.1s; }
@keyframes bubbleUp {
  0%   { transform: translateY(0); opacity: 0.8; }
  100% { transform: translateY(-30px); opacity: 0; }
}
.potion-sparkles {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  width: 80px;
}
/* Sparkle kuning identitas */
.spark {
  position: absolute;
  color: #feb319;
  font-size: 14px;
  animation: sparkle 2s ease-in-out infinite;
}
.s1 { top: 0; left: 0; animation-delay: 0s; }
.s2 { top: 8px; right: 0; animation-delay: 0.5s; }
.s3 { top: -8px; left: 50%; animation-delay: 1s; }
.s4 { top: 15px; left: 30%; animation-delay: 1.5s; }
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.5) translateY(0); }
  50%       { opacity: 1; transform: scale(1.2) translateY(-8px); }
}
.loading-text {
  font-size: 15px;
  color: #4a7fd4;
  font-weight: 500;
  margin: 0;
}
.loading-dots span {
  display: inline-block;
  animation: dotBlink 1.4s ease-in-out infinite both;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0; }
  40%            { opacity: 1; }
}

/* Result area */
.alchemist-result {
  opacity: 0;
}
.alchemist-result.result-fadein {
  animation: resultFadeIn 0.6s ease forwards;
}
@keyframes resultFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Result header */
.result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(92,153,238,0.12);
}
.result-header-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(219,234,254,0.8), rgba(254,243,199,0.6));
  border: 1px solid rgba(92,153,238,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.result-header-text { flex: 1; }
.result-title {
  font-size: 18px;
  font-weight: 700;
  color: #344761;
  margin: 0 0 2px;
}
.result-subtitle {
  font-size: 12.5px;
  color: #9ca3af;
  margin: 0;
}

/* Result sections */
.result-section {
  padding: 4px 0 16px;
}
.result-section-featured {
  background: linear-gradient(135deg, rgba(219,234,254,0.25), rgba(254,243,199,0.15));
  border-radius: 14px;
  padding: 16px 18px 18px;
  margin: 0 -4px;
  border: 1px solid rgba(92,153,238,0.12);
}
.result-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 10px;
}
.result-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-blue   { background: #5c99ee; }
.dot-green  { background: #31c48d; }
.dot-yellow { background: #feb319; }

/* Body text */
.result-body {
  font-size: 14.5px;
  line-height: 1.8;
  color: #535d6b;
  margin: 0;
}

/* Afirmasi text — slightly bolder */
.result-body-afirmasi {
  font-size: 15px;
  font-weight: 600;
  color: #344761;
}

/* Quote block for reframing */
.result-quote {
  font-size: 15px;
  font-style: italic;
  line-height: 1.85;
  color: #344761;
  margin: 0;
  padding: 0;
  border: none;
  position: relative;
}
.result-quote::before {
  content: '\201C';
  font-size: 52px;
  line-height: 0;
  color: rgba(92,153,238,0.25);
  vertical-align: -18px;
  margin-right: 4px;
  font-family: Georgia, serif;
}

/* Divider between sections */
.result-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(92,153,238,0.15), transparent);
  margin: 10px 0 20px;
}

/* Action buttons */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.result-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Open Sans', sans-serif;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}
.result-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}
/* Download — kuning brand */
.btn-download {
  background: linear-gradient(135deg, #d4980e, #feb319);
  color: #344761;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(254, 179, 25, 0.35);
}
.btn-download:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(254, 179, 25, 0.5);
}
/* Retry — outline biru brand */
.btn-retry {
  background: transparent;
  color: #4a7fd4;
  border-color: rgba(92, 153, 238, 0.4);
}
.btn-retry:hover {
  background: rgba(92, 153, 238, 0.08);
  border-color: #5c99ee;
}

/* Download feedback */
.copy-feedback {
  margin-top: 12px;
  font-size: 13px;
  color: #d4980e;
  font-weight: 600;
}
.copy-feedback i { margin-right: 4px; }

/* Footer note */
.alchemist-note {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 12.5px;
  color: #9ca3af;
  margin-top: 28px;
  line-height: 1.6;
}
.alchemist-note i { margin-right: 4px; color: #5c99ee; }
.alchemist-note a { color: #4a7fd4; text-decoration: underline; }
.alchemist-note a:hover { color: #344761; }

/* Error message */
.alchemist-error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(254, 226, 226, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: #b91c1c;
  font-weight: 500;
  margin-bottom: 16px;
  animation: resultFadeIn 0.3s ease forwards;
}
.alchemist-error-msg i { font-size: 15px; flex-shrink: 0; }

/* Footer override — hapus 80px padding atas bawaan .footer agar tidak ada gap kosong */
.affirmation-page .footer {
  padding-top: 0;
}

/* Responsive */
@media (max-width: 576px) {
  .alchemist-card { padding: 28px 20px; border-radius: 20px; }
  .alchemist-btn  { font-size: 14px; padding: 14px 24px; }
  .result-actions { flex-direction: column; }
  .result-btn     { width: 100%; justify-content: center; }
}
