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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 50%, #f3e8ff 100%);
  min-height: 100vh;
  color: #374151;
}

#app {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
}

.screen.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Cards */
.card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 30px;
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
}

.start-card {
  margin-top: 30px;
}

.results-card {
  max-width: 650px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.back-link:hover {
  color: #374151;
}

/* Abandon link */
.abandon-link {
  display: block;
  text-align: right;
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: color 0.2s;
}

.abandon-link:hover {
  color: #ef4444;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 1.6rem;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: #9ca3af;
  font-size: 0.95rem;
}

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

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #fbcfe8;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.form-group input::placeholder {
  color: #d1d5db;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons */
.btn {
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Instructions */
.instructions {
  margin-top: 24px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
}

.instructions h3 {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 10px;
}

.instructions p {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 10px;
}

.instructions ul {
  list-style: none;
  font-size: 0.85rem;
  color: #6b7280;
}

.instructions li {
  margin-bottom: 4px;
}

/* Questions Screen */
#questions-screen {
  flex-direction: column;
  align-items: center;
}

.questions-header {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  width: 100%;
  max-width: 650px;
  position: sticky;
  top: 10px;
  z-index: 100;
  text-align: center;
  margin-bottom: 20px;
}

.questions-header h2 {
  font-size: 1.3rem;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.questions-header p {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-top: 4px;
}

.progress-container {
  margin-top: 12px;
}

.progress-bar {
  background: #e5e7eb;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

#progress-text {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 6px;
}

.questions-container {
  width: 100%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 100px;
}

.question-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

.question-text {
  font-size: 0.95rem;
  color: #374151;
  margin-bottom: 16px;
  line-height: 1.5;
}

.question-number {
  font-weight: 600;
  color: #ec4899;
}

.partner-name-highlight {
  font-weight: 600;
  color: #a855f7;
}

.rating-buttons {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.rating-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.rating-btn:hover {
  background: #fce7f3;
}

.rating-btn.selected {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: white;
  transform: scale(1.15);
}

.rating-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #9ca3af;
}

.questions-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.questions-footer .btn {
  max-width: 650px;
  margin: 0 auto;
  display: block;
}

/* Results Screen */
#results-screen {
  align-items: flex-start;
  padding-top: 20px;
}

.results-card h2 {
  text-align: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.graph-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

#triangle-graph {
  width: 100%;
  max-width: 350px;
  height: auto;
}

.scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.score-box {
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.score-box.intimacy {
  background: #eff6ff;
}

.score-box.passion {
  background: #fef2f2;
}

.score-box.commitment {
  background: #f0fdf4;
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
}

.intimacy .score-value {
  color: #3b82f6;
}

.passion .score-value {
  color: #ef4444;
}

.commitment .score-value {
  color: #22c55e;
}

.score-label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 4px;
}

.intimacy .score-label {
  color: #1e40af;
}

.passion .score-label {
  color: #b91c1c;
}

.commitment .score-label {
  color: #15803d;
}

.score-max {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 2px;
}

.love-type-box {
  background: linear-gradient(135deg, #fdf2f8, #faf5ff);
  border: 1px solid #f9a8d4;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.love-type-box h4 {
  color: #86198f;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.love-type-box p {
  color: #6b7280;
  font-size: 0.9rem;
}

.interpretation {
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.interpretation h4 {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 10px;
}

.interpretation ul {
  list-style: none;
  font-size: 0.85rem;
  color: #6b7280;
}

.interpretation li {
  margin-bottom: 4px;
}

.buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.privacy-note {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 16px;
}

/* Loading state */
.btn.loading {
  pointer-events: none;
}

.btn.loading svg {
  animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .scores-grid {
    grid-template-columns: 1fr;
  }
  
  .buttons-row {
    grid-template-columns: 1fr;
  }
  
  .rating-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}
