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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F9FAFB;
  color: #111827;
  min-height: 100vh;
}

header {
  background: #1E1B4B;
  color: white;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 { font-size: 18px; font-weight: 600; }

/* Login */
.login-container {
  max-width: 400px;
  margin: 120px auto;
  background: white;
  padding: 48px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.login-container h1 { font-size: 24px; margin-bottom: 6px; }
.subtitle { color: #6B7280; margin-bottom: 32px; }

form { display: flex; flex-direction: column; gap: 12px; }
input[type="email"], input[type="password"], input[type="text"], textarea {
  padding: 12px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 15px;
  width: 100%;
}

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

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.85; }

/* Steps */
.step { max-width: 900px; margin: 48px auto; padding: 0 24px; }
.step.hidden { display: none; }
.step.active { display: block; }

.step h2 { font-size: 22px; margin-bottom: 24px; }

.option-buttons { display: flex; gap: 16px; margin-bottom: 32px; }
.option-btn {
  flex: 1;
  padding: 18px;
  background: white;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  font-size: 15px;
}
.option-btn:hover { border-color: #4F46E5; }

.panel { margin-top: 8px; }

#topic-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
#topic-list li {
  padding: 16px 20px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
#topic-list li:hover { border-color: #4F46E5; background: #F5F3FF; }

/* Generating */
#step-generating { text-align: center; padding-top: 80px; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid #E5E7EB;
  border-top-color: #4F46E5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Review */
.review-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.card-preview { position: relative; }

.card-preview a {
  display: block;
  position: relative;
}

.card-preview a::after {
  content: "🔍 Click to view full size";
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.card-preview a:hover::after { opacity: 1; }

.card-preview img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-content h3 { font-size: 20px; margin-bottom: 12px; color: #111827; }
.post-content p { color: #374151; line-height: 1.7; margin-bottom: 12px; }
.hashtags { color: #4F46E5; font-size: 13px; }

.review-actions { display: flex; flex-direction: column; gap: 16px; }

.btn-approve {
  background: #16A34A;
  color: white;
  font-size: 16px;
  padding: 16px;
  border-radius: 10px;
}

.improve-section { display: flex; flex-direction: column; gap: 10px; }
.btn-improve {
  background: #EF4444;
  color: white;
  padding: 14px;
  border-radius: 10px;
}

/* Done */
#step-done { text-align: center; padding-top: 80px; }
.success-icon {
  width: 72px; height: 72px;
  background: #D1FAE5;
  color: #16A34A;
  border-radius: 50%;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

#btn-new { background: #4F46E5; color: white; margin-top: 20px; padding: 14px 32px; }

.hint { color: #9CA3AF; font-size: 13px; margin-top: 8px; }
.error { color: #EF4444; font-size: 13px; }
.hidden { display: none !important; }
.loading { color: #6B7280; font-style: italic; }
