:root {
  color-scheme: dark light;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #05060a;
  color: #f5f6f8;
  --bg-top: #060b1c;
  --bg-bottom: #11193d;
  --card-border: rgba(114, 141, 255, 0.45);
  --card-glow: rgba(21, 30, 73, 0.8);
  --accent-start: #5f7aff;
  --accent-end: #8d45ff;
  --badge-bg: rgba(118, 141, 255, 0.18);
  --logo-width: 140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 0%, rgba(138, 108, 255, 0.2), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(93, 201, 255, 0.2), transparent 40%),
    linear-gradient(135deg, var(--bg-top), var(--bg-bottom));
  color: #f5f6f8;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem 4rem;
}

.app-container {
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.badge-logo {
  width: var(--logo-width);
  height: auto;
  display: block;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: #8da2f6;
  margin: 0 0 0.4rem;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 0.3rem;
}

.subheading {
  margin: 0;
  color: #b8c2ff;
  max-width: 640px;
  line-height: 1.5;
}

.badge {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: var(--badge-bg);
  border: 1px solid rgba(141, 162, 246, 0.7);
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 10px 35px rgba(13, 16, 40, 0.5);
}

.chat-card {
  background: radial-gradient(circle at top, rgba(34, 46, 99, 0.55), rgba(7, 10, 24, 0.95));
  border: 1px solid var(--card-border);
  border-radius: 26px;
  padding: 1.7rem;
  box-shadow: 0 40px 90px rgba(2, 6, 23, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  backdrop-filter: blur(18px);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.message {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 0.98rem;
  animation: fadeIn 0.25s ease;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4158d0, #c850c0);
  color: #fff;
}

.message.assistant {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1.75rem 1.5rem 2rem;
  background: radial-gradient(circle at 40% 0%, rgba(111, 146, 255, 0.3), transparent 60%),
    linear-gradient(160deg, rgba(15, 21, 52, 0.95), rgba(5, 7, 18, 0.92));
  border: 1px solid rgba(141, 162, 246, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 15px 35px rgba(7, 9, 20, 0.45);
}

.message.assistant p {
  margin: 0;
  width: 100%;
  max-width: 520px;
  line-height: 1.6;
  color: #e6e9ff;
  text-align: center;
}

.welcome-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.welcome-text span {
  display: block;
}

.welcome-text span:first-child {
  font-size: 1.15em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.welcome-text span:nth-child(2) {
  font-size: 0.9em;
  font-weight: 400;
  color: rgba(230, 233, 255, 0.85);
}

.analysis-result {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analysis-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  text-align: center;
}

.numbers-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.number-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
}

.number-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

.number-value {
  background: linear-gradient(160deg, rgba(15, 21, 52, 0.95), rgba(5, 7, 18, 0.92));
  border: 1px solid rgba(141, 162, 246, 0.4);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd700;
  text-align: center;
  min-width: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.explanations {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  margin-top: 0.5rem;
}

.explanation-item {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e6e9ff;
}

.explanation-item strong {
  color: #ffffff;
  font-weight: 600;
}

.message.assistant .analysis-result {
  text-align: center;
}

.action-buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  width: 100%;
  flex-wrap: wrap;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(141, 162, 246, 0.5);
  color: #e6e9ff;
  background: rgba(20, 29, 63, 0.6);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(10, 13, 27, 0.5);
  margin: 0;
  vertical-align: middle;
}

.action-button:hover {
  border-color: rgba(141, 162, 246, 0.8);
  background: rgba(30, 46, 105, 0.8);
  transform: translateY(-1px);
}

.action-button:active {
  transform: translateY(0);
}

.action-button.copied {
  border-color: #4ade80;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.action-button svg {
  flex-shrink: 0;
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

.action-button span {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  margin: 0;
  padding: 0;
}

.pasang-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  width: 100%;
}

.pasang-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(110, 152, 255, 0.8);
  color: #f5f6f8;
  background: linear-gradient(120deg, rgba(20, 29, 63, 0.95), rgba(26, 38, 85, 0.95));
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(10, 13, 27, 0.5);
  font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  box-sizing: border-box;
}

.pasang-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(110, 152, 255, 0.8);
  color: #f5f6f8;
  background: linear-gradient(120deg, rgba(20, 29, 63, 0.95), rgba(26, 38, 85, 0.95));
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(10, 13, 27, 0.5);
  font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap;
  box-sizing: border-box;
  margin: 0;
  vertical-align: middle;
}

.pasang-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
  margin: 0;
  padding: 0;
}

.pasang-button:hover {
  border-color: #ffffff;
  background: linear-gradient(120deg, rgba(30, 46, 105, 0.95), rgba(41, 62, 122, 0.95));
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 25px rgba(10, 13, 27, 0.6);
}

.pasang-button:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 6px 15px rgba(10, 13, 27, 0.5);
}

@media (max-width: 480px) {
  .analysis-result {
    gap: 1rem;
  }
  
  .analysis-title {
    font-size: 1.1em;
  }
  
  .numbers-container {
    gap: 0.6rem;
  }
  
  .number-box {
    min-width: 90px;
  }
  
  .number-label {
    font-size: 0.85rem;
  }
  
  .number-value {
    font-size: 0.95rem;
    padding: 0.5rem 0.8rem;
    min-width: 80px;
  }
  
  .explanations {
    gap: 0.6rem;
    margin-top: 0.4rem;
  }
  
  .explanation-item {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .message.assistant {
    padding: 1.25rem 1rem 1.4rem;
  }
  
  .pasang-button {
    font-size: 0.85rem;
    padding: 0.65rem 1.5rem;
  }
  
  .action-buttons-container {
    gap: 0.5rem;
    margin-top: 0.8rem;
  }
  
  .action-button {
    padding: 0.65rem 1.2rem;
    min-height: 40px;
    height: 40px;
    font-size: 0.85rem;
    line-height: 1;
    text-align: center;
  }
  
  .action-button svg {
    width: 14px;
    height: 14px;
  }
  
  .action-button span {
    line-height: 1;
  }
  
  .pasang-button {
    padding: 0.65rem 1.2rem;
    min-height: 40px;
    height: 40px;
    font-size: 0.85rem;
    line-height: 1;
    text-align: center;
  }
  
  .pasang-button span {
    line-height: 1;
  }
  
  .pasang-button-container {
    margin-top: 0.8rem;
  }
  
  .voice-button {
    width: 2.25rem;
    height: 2.25rem;
    bottom: 0.65rem;
    right: 0.65rem;
  }
  
  .voice-button svg {
    width: 16px;
    height: 16px;
  }
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

label {
  font-size: 0.95rem;
  color: #c7d3ff;
}

.textarea-wrapper {
  position: relative;
  width: 100%;
}

textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(141, 162, 246, 0.4);
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  padding-right: 3.5rem;
  color: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.voice-button {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(141, 162, 246, 0.4);
  background: rgba(20, 29, 63, 0.6);
  color: #8da2f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.voice-button:hover {
  border-color: rgba(141, 162, 246, 0.8);
  background: rgba(30, 46, 105, 0.8);
  color: #b8c2ff;
  transform: scale(1.05);
}

.voice-button:active {
  transform: scale(0.95);
}

.voice-button.listening {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

textarea:focus {
  border-color: #8da2f6;
  box-shadow: 0 0 0 3px rgba(141, 162, 246, 0.25);
}

.primary-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.5rem;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  color: #05060a;
  background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
  box-shadow: 0 20px 35px rgba(78, 96, 255, 0.35);
  vertical-align: middle;
  box-sizing: border-box;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(78, 96, 255, 0.45);
}

.primary-btn[data-loading="true"] {
  opacity: 0.75;
  pointer-events: none;
}

.btn-progress {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid rgba(5, 6, 10, 0.2);
  border-top-color: #05060a;
  margin-left: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  flex-shrink: 0;
}

.primary-btn[data-loading="true"] .btn-progress {
  opacity: 1;
}

.primary-btn[data-loading="true"] .btn-label {
  opacity: 0.65;
}

.btn-label {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: center;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 152, 255, 0.8);
  color: #f5f6f8;
  background: linear-gradient(120deg, rgba(20, 29, 63, 0.95), rgba(26, 38, 85, 0.95));
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border 0.2s ease, background 0.2s ease, transform 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 15px 25px rgba(10, 13, 27, 0.55);
}

.secondary-btn:hover {
  border-color: #ffffff;
  background: linear-gradient(120deg, rgba(30, 46, 105, 0.95), rgba(41, 62, 122, 0.95));
  transform: translateY(-1px);
}

.secondary-btn:active {
  transform: translateY(0);
}

.message.assistant .secondary-btn {
  margin: 0.75rem auto 0;
  min-width: 0;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  border-width: 1px;
  width: var(--logo-width);
  padding: 0.38rem 1.2rem;
  line-height: 1;
  white-space: nowrap;
}

.disclaimer {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  body {
    padding: 1.5rem 1rem 3rem;
    align-items: center;
  }

  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .eyebrow,
  h1,
  .subheading {
    text-align: center;
    width: 100%;
  }

  .subheading {
    margin-left: auto;
    margin-right: auto;
  }

  .badge {
    align-self: center;
  }

  .chat-card {
    padding: 1.25rem;
    text-align: center;
  }

  .message.assistant {
    padding: 1.25rem 1rem 1.6rem;
    gap: 0.8rem;
  }

  .message.assistant p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .message.assistant .secondary-btn {
    font-size: 0.78rem;
    padding: 0.3rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .message.assistant p {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .message.assistant {
    border-radius: 24px;
  }

  .message.assistant .secondary-btn {
    padding: 0.28rem 0.72rem;
  }
}

