@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* PT Core Colors */
  --pt-red-primary: #CC0000;
  --pt-red-dark: #A30000;
  --pt-red-light: #FF3333;
  --pt-red-soft: rgba(204, 0, 0, 0.08);

  /* Banking/Professional Colors */
  --bg-color: #F8F9FA;
  --surface-color: #FFFFFF;
  --text-main: #212529;
  --text-muted: #6C757D;
  --border-light: #E9ECEF;
  --success-color: #28A745;
  --warning-color: #FFC107;

  /* Typography */
  --font-family: 'Inter', sans-serif;

  /* Shadows & Effects */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.12);
  --shadow-red: 0 8px 16px rgba(204, 0, 0, 0.2);
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-pill: 50px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* Mobile App Wrapper */
.app-container {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-color);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

/* Common Utilities */
.text-red { color: var(--pt-red-primary); }
.text-white { color: white; }
.text-bold { font-weight: 600; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--border-radius-pill);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  background-color: var(--pt-red-primary);
  color: white;
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  background-color: var(--pt-red-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--pt-red-primary);
  border: 2px solid var(--pt-red-primary);
}

.btn-outline:hover {
  background-color: var(--pt-red-soft);
}

/* Cards */
.card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  border: 1px solid var(--border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Input Fields */
.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--surface-color);
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--text-main);
}

.input-field:focus {
  outline: none;
  border-color: var(--pt-red-primary);
  box-shadow: 0 0 0 3px var(--pt-red-soft);
}

/* Header / Balance Area (Bank Style) */
.bank-header {
  background: linear-gradient(135deg, var(--pt-red-primary) 0%, var(--pt-red-dark) 100%);
  color: white;
  padding: 2rem 1.5rem 3rem 1.5rem;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: var(--shadow-md);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.user-greeting {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.9;
}

.user-avatar {
  width: 44px;
  height: 44px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pt-red-primary);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.balance-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-bottom: 0.3rem;
}

.balance-amount {
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-icon {
  font-size: 1.8rem;
  color: #FFD700;
}

/* Stories Ring */
.stories-container {
  display: flex;
  gap: 15px;
  padding: 0 1.5rem;
  margin-top: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.stories-container::-webkit-scrollbar {
  display: none;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  min-width: 70px;
}

.story-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(45deg, #FFD700, var(--pt-red-primary), var(--pt-red-dark));
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  box-shadow: var(--shadow-sm);
}

.story-ring.viewed {
  background: var(--border-light);
}

.story-img-container {
  width: 100%;
  height: 100%;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--pt-red-primary);
  border: 2px solid white;
}

.story-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-align: center;
  white-space: nowrap;
}

/* Gamification Progress */
.level-progress-container {
  background: var(--surface-color);
  padding: 1.2rem;
  border-radius: var(--border-radius-md);
  margin: -1.5rem 1.5rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 10;
}

.level-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pt-red-primary), #FF5555);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0 1.5rem;
  margin-bottom: 1.5rem;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.action-item:hover {
  transform: translateY(-2px);
}

.action-icon {
  width: 56px;
  height: 56px;
  background-color: var(--surface-color);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--pt-red-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.action-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  text-align: center;
}

/* News List */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 1.5rem 1rem 1.5rem;
}

.news-list, .mission-list {
  padding: 0 1.5rem;
  padding-bottom: 100px;
}

.news-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  cursor: pointer;
}

.news-card-image {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--pt-red-primary), var(--pt-red-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 3.5rem;
}

.news-card-content {
  padding: 1rem;
}

.news-badge {
  display: inline-block;
  background: var(--pt-red-soft);
  color: var(--pt-red-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.news-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

/* Mission List */
.mission-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: var(--border-radius-md);
  background-color: var(--surface-color);
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.mission-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--pt-red-primary), var(--pt-red-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-right: 1rem;
  flex-shrink: 0;
}

.mission-content {
  flex-grow: 1;
}

.mission-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.mission-reward {
  font-size: 0.85rem;
  color: var(--success-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Affiliation Banner */
.affiliation-banner {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #111;
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed; /* Changed to fixed so it floats properly */
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 420px; /* match container */
  width: 100%;
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-item i {
  font-size: 1.4rem;
}

.nav-item.active {
  color: var(--pt-red-primary);
}

/* Modals */
.survey-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 420px;
  height: 100%;
  background-color: var(--surface-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.survey-modal.open {
  transform: translateY(0);
}

.survey-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  margin-right: 1rem;
}

.survey-content {
  flex-grow: 1;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  line-height: 1.4;
}

.option-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: var(--surface-color);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-btn:hover, .option-btn.selected {
  border-color: var(--pt-red-primary);
  background-color: var(--pt-red-soft);
  color: var(--pt-red-primary);
}

/* Splash Screen / Login */
.login-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 2rem;
}

.login-logo {
  text-align: center;
  margin-top: 4rem;
  margin-bottom: 3rem;
}

.pt-star {
  width: 80px;
  height: 80px;
  fill: var(--pt-red-primary);
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pt-red-primary);
}

/* Reward Overlay */
.reward-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.reward-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.reward-star {
  font-size: 5rem;
  color: #FFD700;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
  margin-bottom: 1rem;
  transform: scale(0.5);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-overlay.show .reward-star {
  transform: scale(1);
}

.reward-text {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.reward-points {
  color: #FFD700;
  font-size: 2.5rem;
  font-weight: 800;
}

/* Animations */
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-slide-up {
  animation: slideUp 0.5s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* --- FASE 4: GLASSMORPHISM & ESTÉTICA PREMIUM --- */

.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.dark-glass-panel {
  background: rgba(204, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* CARTÃO VIRTUAL (WALLET) */
.pt-virtual-card {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #FF1A1A, #A30000);
  border-radius: 20px;
  padding: 1.5rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -15px rgba(204, 0, 0, 0.6), 0 10px 20px rgba(0, 0, 0, 0.1), inset 0 2px 5px rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 2rem;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  z-index: 20;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pt-virtual-card:hover {
  transform: translateY(-8px) rotateX(4deg) rotateY(2deg);
  box-shadow: 0 40px 70px -15px rgba(204, 0, 0, 0.7), 0 15px 25px rgba(0, 0, 0, 0.15), inset 0 2px 5px rgba(255, 255, 255, 0.5);
}

.card-hologram {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.1) 25%, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.card-chip {
  width: 45px;
  height: 30px;
  background: linear-gradient(135deg, #e0c38c, #c59b48);
  border-radius: 5px;
  position: relative;
}

.card-chip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 35px;
  height: 20px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 2px;
}

.card-number {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.4rem;
  letter-spacing: 3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  position: relative;
  z-index: 2;
  margin-top: 20px;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  z-index: 2;
}

.card-name {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.card-level {
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFD700;
  text-transform: uppercase;
}

/* RANKING (LEADERBOARD) */
.ranking-list {
  padding: 0 1.5rem;
  padding-bottom: 100px;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 12px 1rem;
  background: var(--surface-color);
  border-radius: var(--border-radius-md);
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.ranking-item.is-me {
  background: var(--pt-red-soft);
  border: 1px solid var(--pt-red-primary);
}

.ranking-pos {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 30px;
  text-align: center;
  margin-right: 15px;
}

.ranking-pos.top-1 { color: #FFD700; font-size: 1.5rem; text-shadow: 0 2px 4px rgba(255,215,0,0.3); }
.ranking-pos.top-2 { color: #C0C0C0; font-size: 1.3rem; }
.ranking-pos.top-3 { color: #CD7F32; font-size: 1.2rem; }

.ranking-avatar {
  width: 40px;
  height: 40px;
  background: var(--pt-red-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 15px;
}

.ranking-info {
  flex-grow: 1;
}

.ranking-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.ranking-points {
  font-weight: 700;
  color: var(--success-color);
  font-size: 0.9rem;
}

/* REWARD CONFETTI */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--pt-red-primary);
  opacity: 0;
}

.reward-overlay.show .confetti {
  animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.view {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.view.active {
  display: flex;
}
