/* common.css – Stile unificato STEP */

:root {
  --color-bg-light: #fdf6e3;
  --color-bg-paper: #fff8e1;
  --color-paper-contrast: #fff2c6;
  --color-section-highlight: #f5e1b8;
  --color-primary: #ff9800;
  --color-primary-dark: #fb8c00;
  --color-accent: #f3a738;
  --color-text: #3d2c1a;
  --color-muted: #888;
  --radius: 0.75rem;
  --font-main: 'Inter', sans-serif;
  --font-accent: 'Playfair Display', serif;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg-light);
  color: var(--color-text);
  line-height: 1.5;
  padding: 1rem;
}

.header-step {
  background: var(--color-primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin: 0 auto 2rem auto;
  max-width: 860px;
  font-weight: 600;
}

.header-step h1 {
  font-size: 1.6rem;
  margin: 0;
  font-weight: 800;
}

.page-dashboard .header-step {
  position: relative;
  overflow: hidden;
}

.header-with-sun {
  position: relative;
  overflow: hidden;
}

.header-with-sun .sun-deco {
  position: absolute;
  top: -0.8rem;
  left: -0.8rem;
  width: 3rem;
  height: 3rem;
  background: radial-gradient(circle at center, #ffd54f 40%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.auth-badge {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: white;
  padding: 0.25em 0.7em;
  border-radius: 2em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

.auth-dashboard-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 600;
  gap: 0.5rem;
}

.auth-separator {
  width: 1px;
  height: 18px;
  background: var(--color-primary);
  opacity: 0.2;
  margin: 0 0.5em;
}

.auth-avatar-img {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-avatar-fallback {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logout {
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5em;
  text-decoration: none;
}

.button-step {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.button-step:hover {
  background: var(--color-primary-dark);
}

.button-step.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1;
}

.section-step {
  background: var(--color-section-highlight);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-step h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quote-step {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.1rem;
  text-align: center;
  margin: 2rem 0;
  background: var(--color-section-highlight);
  padding: 1rem;
  border-radius: var(--radius);
}

/* Base goal card */
.goal-card {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.goal-card + .goal-card {
  margin-top: 0.5rem;
}

/* Style variations */
.goal-card.dashed {
  border: 1px dashed #999;
}

.goal-card.solid {
  border: 1px solid #ddd;
}

/* Stile visivo per obiettivi completati o abbandonati */
.goal-card.done {
  background-color: #e6ffed;
  border-left: 6px solid #d7ccc8;
}

.goal-card.abandoned {
  background-color: #fff5e6;
  border-left: 6px solid #d7ccc8;
}

/* Internal structure */
.goal-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.goal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.goal-meta > div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.goal-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.goal-summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (min-width: 600px) {
  .goal-summary {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.goal-summary .status-icon {
  font-size: 1.8rem;
  align-self: start;
}

.caption {
  font-weight: bold;
}

.cta-step {
  text-align: center;
  margin: 2rem 0;
}

.cta-step p {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.cta-step button {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.cta-step button:hover {
  background: var(--color-primary-dark);
}

@media (min-width: 768px) {
  body {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
  }
  .section-step {
    padding: 2rem;
  }
  .header-step h1 {
    font-size: 2rem;
  }
}

/* Splash page hero section */
.hero-splash {
  height: 100vh;
  background: url('steps.png') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  padding: 2rem;
}

.hero-splash h1 {
  font-size: 2rem;
  max-width: 22ch;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-splash p {
  font-size: 1rem;
  opacity: 0.9;
}

/* Default avatar image in auth-area */
#auth-area img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* --------------------------
   Form Input Fields
----------------------------- */
.goal-content input[type="text"],
.goal-content input[type="date"] {
  width: calc(100% - 1rem);
  margin-bottom: 0.5rem;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

/* --------------------------
   Button inside goal content
----------------------------- */
.goal-content button {
  background: #f3a738;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); /* aggiunto per coerenza visiva */
}

/* --------------------------
   Icon rows
----------------------------- */
.icon-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.icon-row div {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-row img {
  height: 28px;
  width: auto;
}

/* --------------------------
   Layout responsive section
----------------------------- */
.section {
  text-align: left !important;
}

.section h2 {
  margin-top: 2.5rem;
}

@media(min-width: 768px) {
  .sections {
    display: block;
    padding: 2rem 1rem;
    max-width: 860px;
    margin: 0 auto;
  }

  .section {
    max-width: unset;
  }
}

.goal-info {
  font-size: 0.9rem;
  font-style: italic;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Floating action button (FAB) */
.floating-add {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #ff9800;
  color: white;
  font-size: 2rem;
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.floating-add:hover {
  background: #fb8c00;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.clickable {
  cursor: pointer;
}

.status-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: start;
  font-size: 1.4rem;
}

.status-select .selected {
  background: #ffe0b2;
  outline: 2px solid #ff8c00;
}

.status-select img {
  height: 28px;
  cursor: pointer;
  border-radius: 6px;
}

.status-select img.selected {
  border: 2px solid #f3a738;
  padding: 2px;
  border-radius: 6px;
  background: white;
}

.status-select img:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.status-select span {
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-select span[data-status="unknown"] img {
  filter: brightness(1.5) contrast(1.2) drop-shadow(0 0 1px #00000040);
  opacity: 1;
}

.status-select span:hover {
  background: #ffe0b2;
}

.goal-form {
  background: #f0f9f0;
  border-left: 3px solid #28a745;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0.5rem 0;
}

.minimal-feedback-area {
  background: #f0f9f0;
  border-left: 3px solid #28a745;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
}

.goal-form textarea {
  width: 95%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 1rem;
}

.goal-form .form-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.legend-btn {
  margin-left: 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: #b36b00;
  font-weight: bold;
  vertical-align: middle;
  transition: color 0.2s ease;
}

.legend-btn:hover {
  color: #f3a738;
}

.page-dashboard {
  background-color: #f1d9a7;
  overflow-y: auto;
  min-height: 100vh;
}

.goal-card.dashboard:not(.done):not(.abandoned) {
  background-color: #fff8e1;
}

.modal {
  display: none !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#sponsor-modal {
  display: none !important;
}


/* Pulsante hamburger/drawer */
.hamburger {
  font-size: 1.8rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 1002;
}

/* Container auth + hamburger */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Drawer menu */
.drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 260px;
  height: 100vh;
  background-color: var(--color-primary-dark);
  color: white;
  padding: 2rem 1.2rem;
  transition: right 0.3s ease-in-out;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  box-shadow: -2px 0 6px rgba(0,0,0,0.2);
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
   opacity: 0.9;
}

.drawer.open {
  right: 0;
}

.drawer a {
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
}

.drawer a:hover {
  text-decoration: underline;
}

/* Overlay sfondo */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: none;
}

.drawer-overlay.active {
  display: block;
}

/* =========================================
 * 🎯 STEPPER UX ENHANCEMENTS
 * ========================================= */

.new-goal-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.validate-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ai-feedback {
  background: #f0f9f0;
  border-left: 3px solid #28a745;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  margin: 0.5rem 0;
  display: none;
}

.goal-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #666;
}

.angel-info {
  display: flex;
  align-items: center;
  background: var(--color-paper-contrast);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.header-logo-link {
  text-decoration: none;
  color: inherit;
}

/* =========================================
 * 🎯 MINIMAL DESIGN LAYOUT
 * ========================================= */

.goal-card.minimal-design {
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.minimal-status-row {
  text-align: center;
  margin: 1.5rem 0;
}

.status-question {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.actions-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-dots {
  display: flex;
  gap: 0.7rem;
  padding: 0.5rem;
  background: var(--color-bg-paper);
  border-radius: 2rem;
}

.status-dot {
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.2rem;
  border-radius: 50%;
}

.status-dot:hover {
  transform: scale(1.1);
}

.status-dot.selected {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-icons {
  display: flex;
  gap: 0.6rem;
  padding: 0.3rem;
}

.action-icon {
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
  background: var(--color-section-highlight);
}

.action-icon:hover {
  background: var(--color-paper-contrast);
  transform: translateY(-1px);
}

.goal-title.minimal {
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--color-text);
  text-align: center;
  margin: 1rem 0;
  padding: 0 1rem;
}

/* =========================================
 * 🎯 GOAL CLOSURE MODAL
 * ========================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.2s ease-out;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: modal-slide-up 0.3s ease-out;
}

.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  margin: 0 0 1rem 0;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.modal-body textarea {
  width: 100%;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-body textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
}

.modal-note {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #666;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  border-top: 1px solid #f0f0f0;
}

.button-secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.button-secondary:hover {
  background: #e8e8e8;
  color: #333;
}

.button-primary {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.button-primary:hover {
  background: #e59400;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.button-primary.delete {
  background: #dc3545;
}

.button-primary.delete:hover {
  background: #c82333;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================
 * 🎯 SIGNORI PUNTINI LAYOUT
 * ========================================= */

.question-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 1.5rem;
}

.status-question {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text);
  justify-self: start;
}

.question-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-interaction {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 1rem;
}

.signori-puntini {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-self: start;
}

.status-dot {
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.3;
  transform: scale(1);
}

.status-dot.active {
  opacity: 1;
  transform: scale(1.1);
}

.status-dot:hover {
  transform: scale(1.2);
  opacity: 0.8;
}

.utilities {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-self: end;
}

.utility-btn {
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  opacity: 0.6;
  background: var(--color-section-highlight);
}

.utility-btn:hover {
  opacity: 1;
  transform: translateY(-1px);
  background: var(--color-paper-contrast);
}

.comment-field {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.comment-field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
}

/* Mobile optimizations */
@media (max-width: 600px) {
  .signori-puntini {
    gap: 0.1rem;
  }

  .status-dot {
    font-size: 2.2rem;
  }

  .utilities {
    gap: 0.3rem;
  }

  .utility-btn {
    font-size: 1.1rem;
    padding: 0.3rem;
  }
}