/* =========================================================================
   CLUBE DO ENXOVAL - ESTILOS GLOBAIS
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,800&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  /* Radiant Nest - Paleta de Cores */
  --color-bg-light: #fbf5f1; /* background */
  --color-primary: #a72a51; /* primary */
  --color-primary-container: #ff7195;
  --color-accent: #fed07f; /* tertiary-container */
  --color-text-dark: #302e2c; /* on-surface */
  --color-text-muted: #7a7673; /* outline */
  --color-card-bg: #ffffff; /* surface-container-lowest */
  --color-surface-low: #f6f0eb;
  --color-ghost-border: rgba(177, 172, 169, 0.15); /* outline-variant 15% */
  
  /* Sombras (Ambient Shadows) */
  --shadow-sm: 0 4px 12px rgba(48, 46, 44, 0.03);
  --shadow-md: 0 10px 30px rgba(48, 46, 44, 0.05); /* diffused */
  --shadow-glow: 0 10px 25px -5px rgba(255, 113, 149, 0.4);
  
  /* Bordas Arredondadas */
  --border-radius-xl: 48px;
  --border-radius-lg: 32px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;
  --border-radius-full: 9999px;
  
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Manrope', sans-serif;
  color: var(--color-text-dark);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

*:focus {
  outline: none;
}

button, a, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

html {
  overflow-x: hidden;
  height: 100%;
}

body {
  background-color: var(--color-bg-light);
  min-height: 100vh;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  overscroll-behavior: none;
}

/* Container do App - Mobile First Simulado para Web Desktop */
.app-container {
  width: 100%;
  max-width: 414px;
  height: 100vh;
  height: 100dvh; /* dynamic viewport height for mobile */
  background-color: var(--color-bg-light);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  box-shadow: 0 0 40px rgba(0,0,0,0.1);
  touch-action: pan-y; /* allow only vertical swipe */
}

/* Frame de celular apenas em desktop com mouse (não toca em dispositivos touch reais) */
@media (min-width: 415px) and (hover: hover) and (pointer: fine) {
  .app-container {
    max-height: 896px;
    border-radius: 40px;
    border: 8px solid #333;
  }
}

/* Background blob decorations */
.bg-blob-top-right {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background-color: var(--color-accent);
  border-radius: 50%;
  opacity: 0.3;
  z-index: 0;
}

.bg-blob-top-left {
  position: absolute;
  top: -20px;
  left: -80px;
  width: 150px;
  height: 150px;
  background-color: var(--color-primary-light);
  border-radius: 50%;
  opacity: 0.4;
  z-index: 0;
}

/* Utilitários Visuais */
.z-10 { position: relative; z-index: 10; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

p {
  font-size: 14px;
  color: var(--color-text-muted);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Manrope', sans-serif;
}

.btn-primary {
  background: linear-gradient(to bottom right, var(--color-primary), var(--color-primary-container));
  color: white;
  padding: 16px 24px;
  border-radius: var(--border-radius-full);
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

/* =========================================================================
   HEADER & NAVBAR
   ========================================================================= */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-md);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-primary);
  flex: 1;
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.notification-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.notification-btn i {
  color: var(--color-primary);
  font-size: 18px;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background-color: #FF3B30;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: white;
  border: 2px solid white;
  line-height: 1;
}

/* Bottom Navigation Bar - Glassmorphism */
.bottom-nav {
  position: absolute;
  bottom: 24px;
  left: 20px;
  width: calc(100% - 40px);
  height: auto;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--border-radius-xl);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

/* Esconder navbar nas telas de onboarding */
.onboarding-screen ~ .bottom-nav {
  display: none !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.3s, background 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.nav-item i {
  font-size: 22px;
}

.nav-item span {
  font-size: 10px;
  font-weight: 500;
}

.nav-item.active {
  background: linear-gradient(to bottom right, var(--color-primary), var(--color-primary-container));
  padding: 10px 14px;
  border-radius: var(--border-radius-full);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  animation: navPop 0.25s ease;
}

.nav-item.active i,
.nav-item.active span {
  color: white;
}

@keyframes navPop {
  0%   { transform: translateY(0) scale(0.95); }
  60%  { transform: translateY(-4px) scale(1.05); }
  100% { transform: translateY(-2px) scale(1); }
}

/* =========================================================================
   MAIN VIEW - DASHBOARD
   ========================================================================= */

.main-content {
  padding: 0 var(--spacing-lg) 100px var(--spacing-lg);
}

/* Category Filter Scroll */
.category-filter-scroll {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px var(--spacing-lg);
  margin: 0 calc(var(--spacing-lg) * -1); /* Negative margin to bleed to edges */
  scrollbar-width: none; /* Firefox */
}

.category-filter-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.filter-btn {
  background: #f0f0f0;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}

.filter-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.filter-btn:active {
  transform: scale(0.95);
}

/* Progress Section */
.progress-section {
  text-align: center;
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
}

.progress-semicircle {
  position: relative;
  width: 200px;
  height: 100px; /* Half of width */
  margin: 0 auto;
  overflow: hidden;
}

.progress-arc-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  border: 15px solid #FFE4E8;
  border-radius: 50%;
  box-sizing: border-box;
}

.progress-arc-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  border: 15px solid var(--color-primary);
  border-radius: 50%;
  border-bottom-color: transparent;
  border-right-color: transparent;
  box-sizing: border-box;
  transform: rotate(-45deg); /* Starts at 0 progress */
  transition: transform 1s ease-out;
}

.progress-text {
  position: absolute;
  bottom: 0;
  width: 100%;
  text-align: center;
}

.progress-text p {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.progress-text h3 {
  font-size: 20px;
  color: var(--color-primary);
  font-weight: 700;
}

/* Categories Section */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.category-card {
  background-color: var(--color-card-bg);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-lg) var(--spacing-md);
  text-align: center;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  border: 1px solid var(--color-ghost-border);
}

.category-card:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary-light);
}

/* Base Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-ghost-border);
  box-shadow: var(--shadow-md);
}

.text-gradient {
  background: linear-gradient(to bottom right, var(--color-primary), var(--color-primary-container));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.category-card:active {
  transform: scale(0.95);
  border-color: var(--color-primary-light);
}

.category-icon {
  width: 48px;
  height: 48px;
  background-color: var(--color-bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.category-icon i {
  font-size: 24px;
  color: #333;
}

.category-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.category-info p {
  font-size: 12px;
}

/* Community Offers Banner */
.offers-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, #FF6b81 100%);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.offers-banner h3 {
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.offer-card {
  background-color: white;
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
}

.offer-img {
  width: 60px;
  height: 60px;
  background-color: #f5f5f5;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
}

.offer-details {
  flex: 1;
}

.offer-details h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.offer-price {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 16px;
}

.offer-price-old {
  font-size: 12px;
  text-decoration: line-through;
  margin-left: 6px;
}

/* =========================================================================
   SCREENS VISIBILITY
   ========================================================================= */

.screen {
  display: none !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg-light); /* Fundo garantido para cobrir as de baixo */
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
}

.screen.active {
  display: block !important;
  animation: fadeIn 0.3s ease-out;
  z-index: 20; /* Fica acima das inativas se por acaso vazarem */
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   ONBOARDING SCREENS
   ========================================================================= */

.onboarding-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--spacing-xl) var(--spacing-lg);
}

.onboarding-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  margin-top: 40px;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: var(--spacing-lg);
}

.step-dot {
  width: 10px;
  height: 10px;
  background-color: #E0E0E0;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.step-dot.active {
  background-color: var(--color-primary);
  width: 24px;
  border-radius: 10px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1;
}

.option-card {
  background-color: var(--color-card-bg);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  border: 1px solid var(--color-ghost-border);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.option-card.selected {
  border: 2px solid var(--color-primary);
  background-color: #FFF0F2;
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.option-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.onboarding-footer {
  margin-top: auto;
  padding-bottom: 20px;
}

/* Inputs e Forms */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-weight: 600;
  font-size: 14px;
}

.input-group input, .input-group select {
  padding: 16px 20px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-ghost-border);
  background-color: var(--color-card-bg);
  font-size: 16px;
  outline: none;
  font-family: 'Manrope', sans-serif;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.input-group input:focus, .input-group select:focus {
  border-color: var(--color-primary-container);
  box-shadow: 0 0 0 4px rgba(255, 113, 149, 0.15);
}

/* Custom Range Slider */
.slider-container {
  width: 100%;
  margin-top: 8px;
}

.item-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: #FFE4E8;
  border-radius: 4px;
  outline: none;
}

.item-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(255, 143, 155, 0.4);
}

.item-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(255, 143, 155, 0.4);
  border: none;
}

/* Slider Completed State (Green) */
.item-slider.completed {
  background: #D1FAE5; /* Fundo verde clarinho */
}

.item-slider.completed::-webkit-slider-thumb {
  background: #10B981 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') center no-repeat;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.4);
}

.item-slider.completed::-moz-range-thumb {
  background: #10B981 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') center no-repeat;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.4);
}
