:root {
  --color-principal: #111827;
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b7280;
  --border: #e5e7eb;
  --error: #dc2626;
  --radius: 18px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.state { width: 100%; max-width: 420px; }
.hidden { display: none !important; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  margin: 0 auto 16px;
  display: block;
}

h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
}

.question {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 20px;
}

.muted { color: var(--muted); font-size: 0.95rem; margin: 0; }

.stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.star {
  background: none;
  border: none;
  font-size: 2.6rem;
  line-height: 1;
  color: #d1d5db;
  cursor: pointer;
  padding: 6px;
  min-width: 48px;
  min-height: 48px;
  transition: color 0.15s ease, transform 0.1s ease;
}

.star:active { transform: scale(0.92); }
.star:focus-visible { outline: 2px solid var(--color-principal); outline-offset: 2px; border-radius: 8px; }
.star.filled { color: var(--color-principal); }

.extra-fields {
  text-align: left;
  margin-top: 12px;
  overflow: hidden;
  max-height: 400px;
  opacity: 1;
  transition: max-height 0.28s ease, opacity 0.28s ease, margin 0.28s ease;
}

.extra-fields.hidden {
  display: block !important;
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.extra-fields label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--text);
}

.extra-fields textarea,
.extra-fields input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.extra-fields textarea:focus,
.extra-fields input:focus {
  outline: 2px solid var(--color-principal);
  outline-offset: 1px;
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 6px 0 0;
}

.submit-btn {
  width: 100%;
  margin-top: 22px;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: var(--color-principal);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  min-height: 50px;
}

.submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.submit-btn:active:not(:disabled) { transform: scale(0.98); }

.error-msg {
  color: var(--error);
  font-size: 0.88rem;
  margin-top: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--color-principal);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

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

.check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-principal);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
