@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --gradient-2: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.04) 0%, transparent 60%);
  z-index: -1;
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-2%, -2%) rotate(3deg); }
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* Header */
.app-header {
  text-align: center;
  padding: 40px 0 32px;
}

.app-header .logo {
  width: 64px;
  height: 64px;
  background: var(--gradient-1);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px var(--accent-glow);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.app-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.app-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-info span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-info .step-label {
  color: var(--accent-light);
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  background: var(--bg-glass);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Steps Dots */
.steps-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.steps-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  transition: var(--transition);
}

.steps-dots .dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: scale(1.2);
}

.steps-dots .dot.completed {
  background: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: cardIn 0.4s ease-out;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title .icon {
  font-size: 1.3rem;
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 24px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group label .required {
  color: var(--error);
  margin-left: 2px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(99, 102, 241, 0.05);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Radio & Checkbox Groups */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-group label, .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-primary);
  transition: var(--transition);
  user-select: none;
}

.radio-group label:hover, .checkbox-group label:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}

.radio-group input:checked + span,
.checkbox-group input:checked + span {
  color: var(--accent-light);
}

.radio-group label:has(input:checked),
.checkbox-group label:has(input:checked) {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 1px var(--accent);
}

.radio-group input, .checkbox-group input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Rating Scale */
.rating-scale {
  display: flex;
  gap: 0;
  margin-top: 4px;
}

.rating-scale label {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  user-select: none;
}

.rating-scale label:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.rating-scale label:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.rating-scale label:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
}

.rating-scale label:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.rating-scale input { display: none; }

.rating-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Buttons */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--gradient-1);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Alert Messages */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  animation: shakeIn 0.4s ease;
}

@keyframes shakeIn {
  0% { transform: translateX(-8px); opacity: 0; }
  50% { transform: translateX(4px); }
  100% { transform: translateX(0); opacity: 1; }
}

.alert.show { display: flex; }

.alert-error {
  background: var(--error-glow);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: var(--success-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* Validation Error */
.field-error {
  color: #fca5a5;
  font-size: 0.78rem;
  margin-top: 6px;
  display: none;
}

.field-error.show { display: block; }

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 2px var(--error-glow);
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Success Screen */
.success-screen {
  text-align: center;
  padding: 48px 24px;
}

.success-screen .check-icon {
  width: 80px;
  height: 80px;
  background: var(--success);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px var(--success-glow);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.success-screen h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.success-screen p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Section hidden */
.section { display: none; }
.section.active { display: block; }

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 16px 12px 48px; }
  .card { padding: 24px 18px; }
  .app-header h1 { font-size: 1.4rem; }
  .radio-group, .checkbox-group { flex-direction: column; }
  .radio-group label, .checkbox-group label { width: 100%; }
  .btn-group { flex-direction: column-reverse; }
  .rating-scale label { padding: 10px 4px; font-size: 0.8rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* File loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 9999;
}

.loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Other input (Lainnya) */
.other-input-wrapper {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
