/*
 * style.css — TindArt v4 — CSS funzionale pre-Figma
 * Obiettivo: app usabile su mobile, zero design.
 * Isabel sostituirà questo file con il design definitivo.
 *
 * Classi strutturali usate da JS (NON modificare i nomi):
 *   .hidden, .screen, .screen-content, .active, .spinner
 *   .swipe-card, .swipe-img, .swipe-overlay-like, .swipe-overlay-nope
 *   .loading-step, .likert-scale, .likert-option
 *   .collection-item, .stat-card, .visit-card
 */

/* ── Reset base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #111;
  background: #fff;
  overscroll-behavior: none;
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Screens ────────────────────────────────────────────────── */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen-content {
  flex: 1;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.screen-center {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.screen-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-topbar .screen-title { flex: 1; }

/* ── Typography ─────────────────────────────────────────────── */
.app-logo {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.screen-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.screen-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
}

.field-label {
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.error-text {
  font-size: 13px;
  color: #c0392b;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.7; }

.btn-primary {
  background: #111;
  color: #fff;
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: #111;
  border: 1.5px solid #ddd;
  width: 100%;
}

.btn-back {
  background: transparent;
  border: none;
  font-size: 20px;
  padding: 8px;
  color: #111;
  flex-shrink: 0;
}

.btn-lang {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
  color: #111;
  width: 100%;
  font-size: 17px;
  border-radius: 12px;
  padding: 16px 20px;
}
.lang-flag { font-size: 24px; }

/* Like / Nope */
.swipe-buttons,
.visit-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
  margin-top: auto;
}

.btn-nope {
  flex: 1;
  background: #ffeaea;
  color: #c0392b;
  border-radius: 16px;
  padding: 16px;
  font-size: 15px;
}

.btn-like {
  flex: 1;
  background: #eafff2;
  color: #27ae60;
  border-radius: 16px;
  padding: 16px;
  font-size: 15px;
}

/* ── S2 — Onboarding ────────────────────────────────────────── */
.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
}

.step-icon { font-size: 20px; flex-shrink: 0; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 0;
}

.gdpr-text {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-label input { flex-shrink: 0; margin-top: 3px; width: 18px; height: 18px; }

.link-privacy {
  font-size: 13px;
  color: #555;
  text-decoration: underline;
}

/* ── S3 — Tutorial ──────────────────────────────────────────── */
.tutorial-card-demo {
  width: 100%;
  aspect-ratio: 3/4;
  background: #f0f0f0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-card-placeholder {
  font-size: 48px;
  opacity: 0.3;
}

.tutorial-arrows {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}

.tutorial-desc {
  font-size: 15px;
  color: #333;
  line-height: 1.6;
}

.tutorial-tip {
  font-size: 13px;
  color: #888;
  font-style: italic;
}

/* ── S4 — Swipe ─────────────────────────────────────────────── */
.screen-swipe { gap: 12px; }

.swipe-header {
  display: flex;
  justify-content: center;
}

.swipe-counter {
  font-size: 14px;
  font-weight: 600;
  color: #888;
}

.swipe-warning {
  font-size: 13px;
  color: #e67e22;
  text-align: center;
  background: #fff8f0;
  padding: 8px 12px;
  border-radius: 8px;
}

.swipe-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 20px;
  overflow: hidden;
  background: #f0f0f0;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  transition: transform 0.05s linear;
}

.swipe-card:active { cursor: grabbing; }

.swipe-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  draggable: false;
}

.swipe-overlay-like,
.swipe-overlay-nope {
  position: absolute;
  top: 20px;
  font-size: 22px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
}

.swipe-overlay-like {
  right: 16px;
  color: #27ae60;
  border: 3px solid #27ae60;
}

.swipe-overlay-nope {
  left: 16px;
  color: #c0392b;
  border: 3px solid #c0392b;
}

.swipe-img-missing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #888;
  background: #f5f5f5;
}

.swipe-title {
  font-size: 14px;
  color: #555;
  text-align: center;
  min-height: 20px;
}

/* ── S5 — Loading ───────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-title {
  font-size: 18px;
  font-weight: 600;
}

.loading-text { font-size: 15px; color: #555; }

.loading-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  width: 100%;
  max-width: 280px;
}

.loading-step {
  font-size: 14px;
  color: #bbb;
  padding-left: 20px;
  position: relative;
  transition: color 0.3s;
}

.loading-step::before {
  content: '○';
  position: absolute;
  left: 0;
}

.loading-step.active {
  color: #111;
  font-weight: 600;
}

.loading-step.active::before { content: '●'; }

/* ── S6a — Profile reveal ───────────────────────────────────── */
.screen-reveal { text-align: center; }

.profile-badge {
  font-size: 20px;
  font-weight: 700;
  padding: 16px 24px;
  background: #f5f5f5;
  border-radius: 16px;
  line-height: 1.3;
}

.profile-text {
  font-size: 15px;
  color: #333;
  line-height: 1.7;
  text-align: left;
  background: #fafafa;
  padding: 16px;
  border-radius: 12px;
  min-height: 80px;
}

.profile-confidence-low {
  font-size: 13px;
  color: #e67e22;
  background: #fff8f0;
  padding: 10px 14px;
  border-radius: 8px;
}

/* ── S6b — Q1 ───────────────────────────────────────────────── */
.likert-fieldset {
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.likert-scale {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.likert-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex: 1;
}

.likert-option input { width: 20px; height: 20px; cursor: pointer; }

.likert-value {
  font-size: 13px;
  font-weight: 600;
  color: #888;
}

.likert-option input:checked + .likert-value { color: #111; }

.likert-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
}

/* ── S7 — Home Hub ──────────────────────────────────────────── */
.home-header { padding: 8px 0; }

.home-greeting {
  font-size: 22px;
  font-weight: 700;
}

.home-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #f5f5f5;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.home-nav-item:active { background: #eee; }

.home-nav-primary { background: #111; color: #fff; }
.home-nav-primary:active { background: #333; }

.home-nav-icon { font-size: 22px; flex-shrink: 0; }
.home-nav-label { flex: 1; }

.home-nav-badge {
  font-size: 12px;
  color: #888;
  font-weight: 400;
}

/* ── S8 — Scelta durata ─────────────────────────────────────── */
.visit-modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visit-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 20px;
  background: #f5f5f5;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.visit-mode-btn:active { background: #eee; }

.visit-mode-label { font-size: 16px; font-weight: 600; }
.visit-mode-desc  { font-size: 13px; color: #888; }

/* ── S9 — Visita virtuale ───────────────────────────────────── */
.screen-visit { gap: 10px; }

.visit-header { display: flex; justify-content: center; }

.visit-progress {
  font-size: 13px;
  font-weight: 600;
  color: #888;
}

.visit-saved-badge {
  font-size: 13px;
  color: #27ae60;
  text-align: center;
  background: #eafff2;
  padding: 8px;
  border-radius: 8px;
}

.visit-card {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #f0f0f0;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.visit-card:active { cursor: grabbing; }

.visit-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.visit-meta {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.visit-title  { font-size: 16px; font-weight: 700; }
.visit-author { font-size: 13px; color: #555; }

.visit-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: #eee;
  color: #555;
}

.visit-detail-panel {
  padding: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.visit-explanation {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  font-style: italic;
}

.visit-links { display: flex; gap: 12px; }

.link-external {
  font-size: 13px;
  color: #555;
  text-decoration: underline;
}

/* ── S10a — Feedback ────────────────────────────────────────── */
.feedback-summary {
  font-size: 15px;
  color: #555;
}

.free-text-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

/* ── S10b — Report B ────────────────────────────────────────── */
.reportb-text {
  font-size: 15px;
  color: #333;
  line-height: 1.7;
  background: #fafafa;
  padding: 16px;
  border-radius: 12px;
  min-height: 80px;
}

/* ── Collezione ─────────────────────────────────────────────── */
.collection-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.collection-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f9f9f9;
  border-radius: 14px;
  overflow: hidden;
  padding-right: 12px;
}

.collection-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  flex-shrink: 0;
}

.collection-item-info { flex: 1; padding: 12px 0; }
.collection-item-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.collection-item-meta  { font-size: 12px; color: #888; margin-top: 2px; }

.btn-remove-collection {
  background: none;
  border: none;
  font-size: 16px;
  color: #bbb;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.empty-state {
  font-size: 15px;
  color: #888;
  text-align: center;
  padding: 40px 20px;
  line-height: 1.6;
}

/* ── Statistiche ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: #f5f5f5;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.stat-value { font-size: 28px; font-weight: 900; }
.stat-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.06em; }

.stats-bar-wrap {
  height: 8px;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
}

.stats-bar {
  height: 100%;
  background: #27ae60;
  border-radius: 8px;
  transition: width 0.4s ease;
  width: 0%;
}

.stats-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-top-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.stats-top-label { font-size: 14px; color: #555; }

.pill {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  background: #f0f0f0;
  border-radius: 20px;
  color: #333;
}

/* ── Impostazioni ───────────────────────────────────────────── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid #eee;
  border-radius: 16px;
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}

.settings-item:last-child { border-bottom: none; }

.settings-label { font-weight: 500; }
.settings-code  { font-family: monospace; font-size: 17px; font-weight: 700; color: #111; }
.settings-action { width: auto; padding: 8px 16px; }
.settings-code-desc { font-size: 12px; color: #aaa; padding: 0 18px 12px; }
.settings-about { flex-direction: column; align-items: flex-start; gap: 4px; }
.settings-about-text { font-size: 13px; color: #aaa; }
