:root {
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --panel-bg: #ffffff;
  --border-color: #edf2f7;
  --text-primary: #1a202c;
  --text-secondary: #718096;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --title-font: 'Outfit', sans-serif;
}

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

body {
  background: var(--bg-gradient);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

.background-radial {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  z-index: 1;
  pointer-events: none;
}

.portal-container {
  width: 100%;
  max-width: 900px;
  padding: 40px 20px;
  z-index: 2;
  position: relative;
}

.portal-header {
  text-align: center;
  margin-bottom: 35px;
}

.portal-header .logo {
  font-family: var(--title-font);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-transform: uppercase;
  color: #ffffff;
}

.portal-header .logo span {
  color: #ddddff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.portal-header h1 {
  font-family: var(--title-font);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.portal-header .subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.portal-card {
  background: var(--panel-bg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.portal-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.section-title {
  margin: 0 0 16px 0;
  color: #2d3748;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid #edf2f7;
  padding-bottom: 8px;
  font-family: var(--title-font);
}

/* Tabela de Planos */
.plans-section {
  margin-bottom: 10px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 15px;
}

@media (max-width: 768px) {
  .plans-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.plan-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  user-select: none;
}

.plan-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e0;
}

.plan-box.selected {
  border-color: #764ba2;
  border-width: 2px;
  background-color: rgba(118, 75, 162, 0.02);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(118, 75, 162, 0.1);
}

.plan-box.popular {
  border-color: #cbd5e0;
}

.plan-box.popular.selected {
  border-color: #764ba2;
  border-width: 2px;
}

.badge-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.plan-header {
  text-align: center;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.plan-header h4 {
  margin: 0 0 10px 0;
  color: #4a5568;
  font-size: 16px;
  font-weight: 600;
}

.plan-header .price {
  color: #1a202c;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.plan-header .price .currency {
  font-size: 16px;
  font-weight: 600;
  margin-right: 2px;
}

.plan-header .price .value {
  font-size: 36px;
  font-weight: 700;
  font-family: var(--title-font);
}

.plan-header .price .cents {
  font-size: 18px;
  font-weight: 600;
}

.plan-header .price .period {
  font-size: 12px;
  color: #718096;
  margin-left: 2px;
}

.plan-features {
  flex: 1;
}

.plan-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-features ul li {
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 8px;
  padding-left: 18px;
  position: relative;
  text-align: left;
}

.plan-features ul li::before {
  content: "✓";
  color: #38a169;
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Formulário */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-row:has(#plan), .form-row:has(#name) {
  grid-template-columns: 1fr;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  text-transform: none;
  letter-spacing: 0;
}

.form-group input, 
.form-group select {
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  padding: 10px 12px;
  color: #1a202c;
  font-family: var(--font-family);
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #764ba2;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.15);
}

.form-group select option {
  background: #ffffff;
  color: #1a202c;
}

.helper-text {
  font-size: 11px;
  color: #718096;
  margin-top: -2px;
}

/* Checkbox Row */
.agreement-checkbox-row {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #764ba2;
  flex-shrink: 0;
}

.checkbox-container label {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.5;
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  user-select: none;
}

.checkbox-container label .inline-link {
  color: #764ba2;
  text-decoration: underline;
  font-weight: 600;
}

.checkbox-container label .inline-link:hover {
  color: #667eea;
}

/* Seção de Ativação / Footer */
.activation-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}

.btn-submit,
.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
  text-align: center;
  width: 100%;
}

.btn-submit:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(118, 75, 162, 0.4);
}

.btn-submit:active,
.btn-primary:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  background: #cbd5e0;
  color: #718096;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.license-agreement-text {
  font-size: 12px;
  color: #718096;
  text-align: center;
  line-height: 1.5;
}

.license-agreement-text .license-modal-link {
  color: #764ba2;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.license-agreement-text .license-modal-link:hover {
  color: #667eea;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  width: 100%;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #c62828;
}

.hidden {
  display: none !important;
}

/* Modais de Termos e Licença */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 650px;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--title-font);
  color: #1a202c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.modal-header .btn-close-modal {
  background: none;
  border: none;
  font-size: 28px;
  color: #a0aec0;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.modal-header .btn-close-modal:hover {
  color: #4a5568;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  color: #4a5568;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}

.modal-body h3 {
  margin: 20px 0 8px 0;
  font-size: 12px;
  font-weight: 700;
  color: #2d3748;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-body h3:first-of-type {
  margin-top: 0;
}

.modal-body p {
  margin: 0 0 14px 0;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #edf2f7;
  display: flex;
  justify-content: flex-end;
  background: #f7fafc;
}

.btn-modal-agree {
  padding: 10px 20px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-modal-agree:hover {
  transform: translateY(-1px);
}

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

@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* PIX Payment Screen Styles */
.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
}

.pix-payment-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: #1a202c;
  width: 100%;
}

.pix-payment-card .icon-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

.pix-payment-card .pix-icon {
  background: rgba(118, 75, 162, 0.1);
  border: 2px solid #764ba2;
  color: #764ba2;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--title-font);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
}

.pix-payment-card h2 {
  font-family: var(--title-font);
  font-size: 24px;
  color: #1a202c;
  font-weight: 700;
}

.pix-payment-card .info-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.pix-payment-card .instruction-text {
  font-size: 14px;
  color: #4a5568;
}

.pix-key-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.pix-key-box {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.pix-key-box .pix-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #718096;
}

.pix-key-box .pix-key {
  font-size: 16px;
  color: #2b6cb0;
  font-family: monospace;
}

.btn-copy-pix {
  background: transparent;
  color: #764ba2;
  border: 1px solid #764ba2;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  height: 48px;
  display: flex;
  align-items: center;
}

.btn-copy-pix:hover {
  background: #764ba2;
  color: white;
}

.btn-copy-pix.copied {
  background: #38a169;
  border-color: #38a169;
  color: white;
}

.price-box {
  background: #fcfcfc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 20px;
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  width: 100%;
}

.price-box .label {
  font-size: 13px;
  font-weight: 600;
  color: #718096;
}

.price-box .price-value {
  font-family: var(--title-font);
  font-size: 32px;
  color: #1a202c;
  font-weight: 800;
  margin-top: 5px;
}

.payment-alert-box {
  background-color: #fffaf0;
  border: 1px solid #feebc8;
  color: #c05621;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
}

.payment-alert-box .highlight-hwid {
  background: #ffffff;
  border: 1px dashed #dd6b20;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
  color: #c05621;
}

.pix-payment-card .confirmation-text {
  font-size: 13px;
  color: #718096;
  line-height: 1.6;
}

.portal-footer {
  text-align: center;
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

@media (min-width: 769px) {
  #plan-box-demo {
    grid-column: 2;
  }
}
