/* ==================== RESET E VARIÁVEIS ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --accent: #42a5f5;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #212121;
  --text-primary: #212121;
  --text-light: #757575;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.1);
  --header-height: 56px;
  --drawer-width: 280px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
body.dark-mode {
  --bg: #1a1a1a;
  --card: #2d2d2d;
  --text: #e0e0e0;
  --text-primary: #e0e0e0;
  --text-light: #b0b0b0;
  --border: #404040;
  --shadow: rgba(0, 0, 0, 0.5);
}

body.dark-mode header {
  background: #2d2d2d;
  border-bottom: 1px solid #404040;
}

body.dark-mode .drawer {
  background: #2d2d2d;
  color: #e0e0e0;
}

body.dark-mode .drawer h2,
body.dark-mode .drawer summary {
  color: #e0e0e0;
}

body.dark-mode .drawer a {
  color: #b0b0b0;
}

body.dark-mode .drawer a:hover {
  background: #404040;
  color: #fff;
}

body.dark-mode .modal-content {
  background: #2d2d2d;
  color: #e0e0e0;
}

body.dark-mode .preference-item,
body.dark-mode .stats-section,
body.dark-mode .premium-status,
body.dark-mode .premium-info,
body.dark-mode .premium-benefits {
  background: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .search-box input,
body.dark-mode .profile-section input {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .filter-btn {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: #404040;
}

body.dark-mode .calculator-card {
  background: #2d2d2d;
  color: #e0e0e0;
}

body.dark-mode .tutorial-box {
  background: #1a1a1a;
  border-color: #404040;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ==================== HEADER FIXO ==================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  box-shadow: 0 2px 4px var(--shadow);
  z-index: 1000;
  gap: 0.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

header h1 {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.premium-badge {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.profile-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s;
}

.profile-btn:hover {
  transform: scale(1.1);
}

/* Botão Home */
.home-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1rem;
  height: 1.1rem;
}

.home-btn:hover {
  transform: scale(1.1);
}

/* Ícone Hambúrguer */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1001;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* Animação do Hambúrguer quando menu aberto */
body.menu-open .hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

body.menu-open .hamburger span:nth-child(2) {
  opacity: 0;
}

body.menu-open .hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ==================== MENU LATERAL (DRAWER) ==================== */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--drawer-width);
  height: 100vh;
  background: var(--card);
  box-shadow: 2px 0 8px var(--shadow);
  transform: translateX(-100%);
  transition: transform var(--transition);
  z-index: 999;
  overflow-y: auto;
}

body.menu-open .drawer {
  transform: translateX(0);
}

.drawer-content {
  padding: calc(var(--header-height) + 1rem) 1rem 1rem;
}

.drawer-content h2 {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Busca e Filtro */
.search-box {
  margin: 1rem 0;
}

.search-box input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-btn {
  width: 100%;
  padding: 0.75rem;
  background: #f5f5f5;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.filter-btn:hover {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

.filter-btn.active {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  border-color: #4caf50;
  color: white;
}

.menu-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.menu-section h3 {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.menu-link {
  width: 100%;
  background: none;
  border: none;
  padding: 0.75rem 0;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-link:hover {
  color: var(--primary);
}

/* Botão Home */
.home-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.home-btn:hover {
  background: var(--primary-dark);
}

/* Categorias (Acordeão) */
.category {
  border-bottom: 1px solid var(--border);
}

.category summary {
  padding: 1rem 0;
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
  font-weight: 500;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category summary::-webkit-details-marker {
  display: none;
}

.category summary::after {
  content: '▼';
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.category[open] summary::after {
  transform: rotate(180deg);
}

.category ul {
  list-style: none;
  padding-bottom: 0.5rem;
}

.category li {
  margin: 0;
}

.category a {
  display: block;
  padding: 0.75rem 0 0.75rem 2rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border-radius: 4px;
}

.category a:hover {
  background: var(--bg);
  color: var(--primary);
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 998;
}

body.menu-open .overlay {
  opacity: 1;
  visibility: visible;
}

/* ==================== CONTEÚDO PRINCIPAL ==================== */
main {
  margin-top: var(--header-height);
  padding: 1.5rem 1rem;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.calc-container {
  width: 100%;
  max-width: 600px;
}

/* ==================== CALCULADORA CIENTÍFICA ==================== */
.calculator {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 4px 12px var(--shadow);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
}

/* Display */
.display {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
}

.expression {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  text-align: right;
  word-wrap: break-word;
  min-height: 1.5rem;
}

.result {
  color: white;
  font-size: 1rem;
  text-align: right;
  font-weight: 300;
  min-height: 1rem;
}

/* Teclas */
.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.key {
  background: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 1.25rem;
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  box-shadow: 0 2px 4px var(--shadow);
}

.key:active {
  transform: scal1.5rem;
  line-height: 1.5;
}

.tutorial-box {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-left: 4px solid #4caf50;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.tutorial-box h3 {
  color: #2e7d32;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.tutorial-box p {
  color: #1b5e20;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.key.function {
  background: #e3f2fd;
  color: var(--primary);
}

.key.operator {
  background: var(--primary);
  color: white;
}

.key.operator[data-key="="] {
  background: var(--accent);
}

/* ==================== CALCULADORAS ESPECÍFICAS ==================== */
.specific-calc {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 4px 12px var(--shadow);
  padding: 2rem;
}

.specific-calc h2 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.specific-calc .desc {
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.example-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.example-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.example-btn:active {
  transform: translateY(0);
}

.specific-calc .form-group {
  margin-bottom: 1.5rem;
}

.specific-calc label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.specific-calc input,
.specific-calc select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.specific-calc input:focus,
.specific-calc select:focus {
  outline: none;
  border-color: var(--primary);
}

.specific-calc .result-box {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.specific-calc .result-box h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.specific-calc .result-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(30, 136, 229, 0.2);
}

.specific-calc .result-item:last-child {
  border-bottom: none;
}

.specific-calc .result-label {
  color: var(--text);
  font-weight: 500;
}

.specific-calc .result-value {
  color: var(--primary);
  font-weight: 600;
}

/* ==================== 
.key:hover {
  filter: brightness(0.95);
}

/* ==================== RESPONSIVO ==================== */
@media (min-width: 768px) {
  :root {
    --header-height: 64px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 2rem;
  }

  .calculator {
    max-width: 450px;
    padding: 2rem;
  }

  .display {
    padding: 2rem;
    min-height: 120px;
  }

  .expression {
    font-size: 2rem;
  }

  .result {
    font-size: 1.25rem;
  }

  .keys {
    gap: 1rem;
  }

  .key {
    padding: 1.5rem;
    font-size: 1.5rem;
  }
}

/* ==================== MODAIS ==================== */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--card);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background-color: #f5f5f5;
  color: #333;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Perfil */
.profile-section {
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  font-weight: bold;
  margin: 0 auto 1.5rem;
}

/* Abas do Perfil */
.profile-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
}

.profile-tab {
  flex: 1;
  padding: 0.75rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #757575;
  transition: all 0.3s ease;
}

.profile-tab:hover {
  color: var(--primary);
  background: #f5f5f5;
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toggle Switch para Dark Mode */
.preference-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.preference-label {
  flex: 1;
}

.preference-label span {
  font-weight: 600;
  font-size: 1rem;
  display: block;
  margin-bottom: 0.25rem;
}

.preference-desc {
  font-size: 0.85rem;
  color: #757575;
  margin: 0;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Estatísticas */
.stats-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  border-radius: 10px;
}

.stats-section h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #ddd;
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-item span {
  color: #757575;
}

.stat-item strong {
  color: var(--primary);
  font-weight: 600;
}

/* Aba Premium */
.premium-status {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.premium-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.premium-status h3 {
  margin: 0.5rem 0;
  font-size: 1.3rem;
}

.premium-status p {
  color: #757575;
  margin: 0;
}

.premium-info {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.premium-info h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.code-description {
  background: #e3f2fd;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.code-description strong {
  color: var(--primary);
}

.activation-code-display {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}

.activation-code-display code {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  background: #f5f5f5;
  padding: 0.5rem;
  border-radius: 4px;
}

.btn-copy {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.3s ease;
}

.btn-copy:hover {
  background: #1565c0;
}

.premium-benefits {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.premium-benefits h4 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.premium-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.premium-benefits li {
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.btn-upgrade-profile {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
  transition: all 0.3s ease;
}

.btn-upgrade-profile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.profile-section label {
  display: block;
  font-weight: 500;
  color: #555;
  margin-bottom: 0.5rem;
}

.profile-section input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.profile-section input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
}

.saved-msg {
  display: none;
  background-color: #4caf50;
  color: white;
  padding: 0.75rem;
  border-radius: 4px;
  text-align: center;
  margin-top: 1rem;
  animation: fadeIn 0.3s ease;
}

.saved-msg.show {
  display: block;
}

/* Termos e Política */
.terms-content, .privacy-content {
  line-height: 1.6;
}

.terms-content h3, .privacy-content h3 {
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.terms-content p, .privacy-content p {
  margin-bottom: 1rem;
  color: #555;
}

/* Sobre */
.about-content {
  text-align: center;
}

.app-logo {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.about-content h3 {
  color: var(--primary);
  margin: 1.5rem 0 0.75rem;
}

.about-content ul {
  text-align: left;
  list-style: none;
  padding: 0;
}

.about-content li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.about-content li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.about-content p {
  color: #666;
  margin: 0.5rem 0;
}

/* ==================== SISTEMA PREMIUM ==================== */
.premium-locked {
  text-align: center;
  padding: 2rem;
}

.lock-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.premium-message {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0;
  border: 2px solid #ffb74d;
}

.premium-message h3 {
  color: #f57c00;
  margin-bottom: 1rem;
}

.premium-message p {
  color: #555;
  margin: 0.75rem 0;
}

.trial-ended {
  background: #ffebee;
  color: #c62828;
  padding: 0.75rem;
  border-radius: 4px;
  font-weight: 500;
}

.trial-info {
  color: #1976d2;
  font-weight: 500;
}

.btn-upgrade {
  background: linear-gradient(135deg, #f57c00, #ff9800);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(245, 124, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 124, 0, 0.4);
}

.free-alternative {
  color: #666;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.free-alternative a {
  color: var(--primary);
  text-decoration: underline;
}

.trial-banner {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  color: #1565c0;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
  border: 2px solid #42a5f5;
}

.trial-banner strong {
  font-weight: 700;
}

.trial-banner a {
  color: #0d47a1;
  text-decoration: underline;
  font-weight: 600;
}

/* Modal Upgrade */
.upgrade-content {
  text-align: center;
}

.premium-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.upgrade-content h3 {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.trial-info {
  background: #e8f5e9;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  border-left: 4px solid #4caf50;
}

.trial-info p {
  margin: 0.25rem 0;
}

/* Plans Container */
.plans-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.plan-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.plan-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(30, 136, 229, 0.2);
}

.plan-card.popular {
  border-color: var(--primary);
  border-width: 3px;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.plan-card.selected {
  border-color: #2e7d32;
  border-width: 3px;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.plan-card.selected .plan-badge {
  background: #2e7d32;
}

.plan-badge {
  background: #666;
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 1rem;
}

.popular-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.plan-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  margin: 1rem 0;
}

.plan-price .currency {
  font-size: 1.2rem;
  font-weight: 600;
  color: #666;
}

.plan-price .amount {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
}

.plan-price .period {
  font-size: 0.9rem;
  color: #666;
}

.plan-detail {
  color: #666;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.plan-save {
  color: #2e7d32;
  font-weight: 600;
  font-size: 0.85rem;
  min-height: 1.2rem;
  margin-top: 0.5rem;
}

.price-box {
  background: linear-gradient(135deg, #1e88e5, #42a5f5);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0;
}

.price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
}

.currency {
  font-size: 1.5rem;
  font-weight: 500;
}

.amount {
  font-size: 3.5rem;
  font-weight: bold;
}

.period {
  font-size: 1.2rem;
}

.price-detail {
  margin-top: 0.5rem;
  opacity: 0.9;
}

.premium-features {
  text-align: left;
  margin: 2rem 0;
}

.premium-features h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  text-align: center;
}

.premium-features ul {
  list-style: none;
  padding: 0;
}

.premium-features li {
  padding: 0.75rem 0;
  padding-left: 2rem;
  position: relative;
  color: #333;
}

.premium-features li::before {
  content: "";
  position: absolute;
  left: 0;
}

.payment-info {
  background: #f5f5f5;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  text-align: left;
}

.payment-info p {
  margin: 0.75rem 0;
  color: #555;
}

.payment-info .plan-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.payment-info .plan-list li {
  padding: 0.5rem 0;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
}

.payment-info .plan-list li:last-child {
  border-bottom: none;
}

.payment-info a {
  color: var(--primary);
  text-decoration: underline;
}

.small-text {
  font-size: 0.85rem;
  color: #666;
}

.btn-contact {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin: 1rem 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.selected-plan-info {
  text-align: center;
  padding: 0.75rem;
  background: #e8f5e9;
  border-radius: 6px;
  margin-top: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.activation-section {
  margin: 2rem 0;
  padding: 2rem;
  background: #f5f5f5;
  border-radius: 12px;
  text-align: left;
}

.activation-section h4 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  text-align: center;
}

.info-box {
  background: #e3f2fd;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  margin: 1rem 0;
  line-height: 1.6;
}

.info-box strong {
  color: var(--primary);
  font-size: 1.05rem;
}

.activation-input-group {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.activation-input-group input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  text-transform: uppercase;
  font-family: monospace;
  transition: border-color 0.3s ease;
}

.activation-input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-activate {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  white-space: nowrap;
}

.btn-activate:hover {
  background: #1565c0;
}

.activation-msg {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  min-height: 1rem;
}

.free-calcs {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

.free-calcs p {
  margin: 0.5rem 0;
  color: #555;
}

/* ============================================
   WELCOME SCREEN STYLES
   ============================================ */

.welcome-screen {
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.welcome-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.welcome-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.welcome-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.welcome-subtitle {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Premium Card na Home */
.home-premium-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.premium-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.premium-badge-home {
  background: linear-gradient(135deg, #ffd700, #ffb300);
  color: #000;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

.trial-badge {
  background: #4caf50;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.trial-badge.expired {
  background: #ff5722;
}

.home-premium-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.home-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.home-plan {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

.home-plan:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px var(--shadow);
}

.home-plan.popular {
  border-color: #ffc107;
  border-width: 3px;
}

.popular-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ffc107, #ffb300);
  color: #000;
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.4);
}

.home-plan strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.home-plan .price {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.home-plan small {
  display: block;
  font-size: 0.75rem;
  color: #4caf50;
  font-weight: 600;
}

.btn-upgrade-home {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #1565c0);
  color: white;
  border: none;
  padding: 0.9rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.btn-upgrade-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.4);
}

/* Premium Ativo */
.home-premium-active {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.home-premium-active .premium-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.home-premium-active h3 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.home-premium-active p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* Seção de Calculadoras */
.home-section {
  margin-bottom: 1.5rem;
}

.home-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-align: center;
}

.home-calcs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
}

.home-calc-btn {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 4px var(--shadow);
}

.home-calc-btn:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px var(--shadow);
  background: var(--primary);
  color: white;
}

.calc-icon {
  font-size: 2rem;
}

.calc-name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
}

.home-calc-btn:hover .calc-name {
  color: white;
}

/* Footer */
.home-footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.home-footer p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.home-footer strong {
  color: var(--primary);
}

/* Dark Mode Adjustments */
body.dark-mode .home-premium-card,
body.dark-mode .home-calc-btn {
  background: #2d2d2d;
  border-color: #404040;
}

body.dark-mode .home-plan {
  background: #1a1a1a;
  border-color: #404040;
}

body.dark-mode .home-plan:hover {
  border-color: var(--primary);
}

body.dark-mode .home-footer {
  background: #1a1a1a;
  border-color: #404040;
}

/* Responsive */
@media (max-width: 768px) {
  .welcome-screen {
    padding: 0.8rem;
  }

  .welcome-icon {
    font-size: 2.5rem;
  }

  .welcome-header h1 {
    font-size: 1.5rem;
  }

  .welcome-subtitle {
    font-size: 0.85rem;
  }

  .home-premium-card {
    padding: 1rem;
  }

  .home-premium-card h3 {
    font-size: 1.1rem;
  }

  .home-plans {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .home-plan .price {
    font-size: 1.3rem;
  }

  .btn-upgrade-home {
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
  }

  .home-calcs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .home-calc-btn {
    padding: 0.8rem 0.5rem;
  }

  .calc-icon {
    font-size: 1.8rem;
  }

  .calc-name {
    font-size: 0.75rem;
  }

  .home-footer {
    margin-top: 1.5rem;
  }

  .home-footer p {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .premium-header {
    flex-direction: column;
    align-items: stretch;
  }

  .premium-badge-home,
  .trial-badge {
    text-align: center;
  }
  
  /* Header responsivo para telas pequenas */
  header {
    padding: 0 0.5rem;
    gap: 0.3rem;
  }
  
  header h1 {
    font-size: 0.95rem;
  }
  
  .header-left {
    gap: 0.3rem;
  }
  
  .header-right {
    gap: 0.5rem;
  }
  
  .premium-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  .home-btn,
  .profile-btn {
    font-size: 1.2rem;
    padding: 0.3rem;
  }
}
