/* --- Cyber & Glassmorphism Theme --- */
:root {
  --primary-color: #50fa7b;
  /* Emerald */
  --secondary-color: #bd93f9;
  /* Purple */
  --bg-dark: #0a0a14;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-pink: #ff79c6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-dark);
  background-image:
    linear-gradient(rgba(80, 250, 123, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 250, 123, 0.05) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10 L30 10 L30 30 L50 30 L50 50 L70 50' stroke='rgba(80, 250, 123, 0.03)' fill='none' stroke-width='0.5'/%3E%3Cpath d='M90 10 L70 10 L70 30 L50 30 L50 50 L30 50' stroke='rgba(80, 250, 123, 0.03)' fill='none' stroke-width='0.5'/%3E%3Ccircle cx='10' cy='10' r='1' fill='rgba(80, 250, 123, 0.05)'/%3E%3C/svg%3E");
  background-size: 50px 50px, 50px 50px, 200px 200px;
  color: #e0e0ff;
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
}

.cyber-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, rgba(80, 250, 123, 0.08), transparent 80%);
}

.main-content {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  border-radius: 16px;
}

.container {
  padding: 20px;
  margin-top: 10px;
}

@media (min-width: 768px) {
  .container {
    padding: 30px;
    margin-top: 20px;
  }
}

h1 {
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  font-size: 1.6rem;
  text-shadow: 0 0 10px rgba(80, 250, 123, 0.3);
  cursor: pointer;
  user-select: none;
  margin-bottom: 15px;
  line-height: 1.2;
}

@media (min-width: 480px) {
  h1 {
    font-size: 2rem;
  }
}

@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
}

.pro-edition {
  display: block;
  font-size: 0.8rem;
  color: var(--primary-color);
  margin-top: 5px;
  letter-spacing: 2px;
}

.main-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}

@media (min-width: 768px) {
  .main-header {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    align-items: flex-end;
  }

  h1 {
    margin-bottom: 0;
  }

  .pro-edition {
    display: inline;
    margin-left: 10px;
    font-size: 1rem;
  }
}

h1 i {
  color: var(--primary-color);
}

.title-highlight {
  color: var(--primary-color);
}

.card {
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}

/* Credit Badge Header */
.header-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.save-status {
  font-size: 0.75rem;
  justify-self: center;
  color: #aaa;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .header-controls {
    display: flex;
    width: auto;
    margin-top: 0;
    gap: 15px;
  }
}

.credit-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
}

.credit-badge i {
  color: #f1fa8c;
}

#creditBalance {
  color: #fff;
  font-weight: bold;
}

.topup-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.topup-btn:hover {
  transform: scale(1.2);
}

.small-btn {
  flex: 0 1 auto !important;
  min-width: auto !important;
  padding: 6px 10px !important;
  font-size: 0.8rem !important;
  min-height: 36px !important;
  border-radius: 20px !important;
}

.btn-text {
  display: none;
}

@media (min-width: 380px) {
  .btn-text {
    display: inline;
  }
}

.form-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 150px;
  margin-bottom: 15px;
}

label {
  display: block;
  font-size: 0.8rem;
  color: #a29bfe;
  /* Suave Lavender */
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 12px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(80, 250, 123, 0.1);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.control-button {
  flex: 1 1 calc(50% - 12px);
  min-width: 140px;
  padding: 12px 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  min-height: 48px;
}

.large-btn {
  flex: 1 1 100%;
}

.control-button.optimize {
  background: var(--primary-color);
  color: #000;
}

.control-button.secondary {
  background: var(--secondary-color);
  color: #fff;
}

.control-button.save-local {
  background: #8be9fd;
  color: #000;
}

.control-button.excel {
  background: #1D8B45;
  color: #fff;
}

.control-button:hover:not(:disabled) {
  filter: brightness(1.2);
  transform: scale(1.02);
}

.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modais */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  overflow-y: auto;
  /* Permite scroll se o conteudo for maior que a tela */
  padding: 20px 0;
}

.modal-content {
  width: 95%;
  max-width: 500px;
  margin: auto;
  /* Centraliza horizontalmente e verticalmente com o scroll */
  padding: 30px 20px;
  text-align: center;
  animation: modalIn 0.3s ease-out;
  border-radius: 20px;
  position: relative;
}

.modal-content h3 {
  font-family: 'Orbitron', sans-serif;
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: #fff;
}

.modal-content p {
  margin-bottom: 25px;
  color: #aaa;
}

.modal-content input[type="password"],
.modal-content input[type="text"] {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 15px;
  border-radius: 10px;
  width: 100%;
  margin-bottom: 25px;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 4px;
}

.modal-actions {
  display: flex;
  gap: 15px;
  width: 100%;
}

.modal-actions .control-button {
  flex: 1;
}

.cyber-border {
  border: 1px solid var(--primary-color) !important;
  box-shadow: 0 0 20px rgba(80, 250, 123, 0.2);
}

/* Pricing Grid Modal */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
  margin: 25px 0;
}

.pricing-card {
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.3s ease;
}

.pricing-card h4 {
  color: #fff;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.pricing-card .price {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--primary-color);
  font-family: 'Orbitron', sans-serif;
}

.pricing-card p {
  font-size: 0.85rem;
  color: var(--secondary-color);
}

.pricing-card.highlighted {
  border: 1px solid var(--primary-color);
  background: rgba(80, 250, 123, 0.05);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(80, 250, 123, 0.1);
}

.close-payment {
  background: none;
  border: none;
  color: var(--secondary-color);
  cursor: pointer;
  margin-top: 20px;
  text-decoration: underline;
  font-size: 0.85rem;
}

/* Legal Modals Styles */
.legal-modal {
  max-width: 600px !important;
  text-align: left !important;
}

.legal-text {
  max-height: 45vh;
  overflow-y: auto;
  margin: 15px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #ccc;
  border: 1px solid var(--glass-border);
}

.legal-text h4 {
  color: var(--primary-color);
  margin: 15px 0 5px;
  font-size: 0.95rem;
}

.close-legal {
  width: 100%;
  margin-top: 10px;
}

.icon-cyan {
  color: #8be9fd;
}

.icon-purple {
  color: #bd93f9;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 4U.IA.BR Standardized Footer */
.footer-clean {
  position: relative;
  width: 100%;
  z-index: 10000;
  padding: 2.5rem 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4rem;
}

.footer-clean span {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Scrollbar Custom */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

@media (max-width: 992px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
}

/* --- PWA Install Banner --- */
.install-banner {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 450px;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10002;
  border-radius: 16px;
  animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.install-banner.hidden {
  display: none !important;
}

.install-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.install-icon img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.install-text strong {
  display: block;
  font-size: 0.95rem;
  color: #fff;
}

.install-text p {
  font-size: 0.75rem;
  color: #aaa;
}

.install-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

@keyframes slideUp {
  from {
    bottom: -100px;
    opacity: 0;
  }

  to {
    bottom: 25px;
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .install-banner {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

/* --- Social Sharing Buttons --- */
.social-share-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.social-share-btn:hover {
  transform: translateY(-3px) scale(1.1);
  filter: brightness(1.2);
}

.social-share-btn.wa {
  background: #25D366;
}

.social-share-btn.fb {
  background: #1877F2;
}

.social-share-btn.tw {
  background: #000;
  border: 1px solid #333;
}