:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-dark: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  min-height: 100vh;
  color: white;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo-icon {
  font-size: 2rem;
}

.hero-content {
  text-align: center;
  padding: 60px 0;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}

.highlight {
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 50px;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 80px;
}

.feature-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 40px 30px;
  text-align: center;
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.feature-card p {
  opacity: 0.8;
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 40px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.step {
  text-align: center;
}

.step-number {
  width: 60px;
  height: 60px;
  background: white;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 15px;
}

.step h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.step p {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header .logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 15px;
}

.auth-header h2 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.auth-header p {
  color: var(--text-secondary);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-card {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.form-card h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary);
}

.btn-full {
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* Dashboard */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  background: var(--bg-dark);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar {
  width: 280px;
  background: var(--bg-dark);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-item.active {
  border-left: 3px solid var(--primary-light);
}

.nav-icon {
  font-size: 1.25rem;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 40px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.section-header {
  margin-bottom: 30px;
}

.section-header h1 {
  font-size: 1.75rem;
  margin-bottom: 5px;
}

.section-header p {
  color: var(--text-secondary);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue {
  background: #dbeafe;
}

.stat-icon.green {
  background: #d1fae5;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Quick Actions */
.quick-actions {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.quick-actions h3 {
  margin-bottom: 20px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.action-card:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.action-icon {
  font-size: 2rem;
}

/* Alert */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.alert-warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.alert-warning span {
  font-size: 1.5rem;
}

.alert strong {
  display: block;
  margin-bottom: 5px;
}

.alert p {
  margin: 0;
  font-size: 0.9rem;
}

.alert a {
  color: var(--primary);
}

/* Contratos List */
.contratos-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contrato-item {
  background: white;
  border-radius: var(--radius);
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.contrato-info h4 {
  margin-bottom: 5px;
}

.contrato-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.contrato-actions {
  display: flex;
  gap: 10px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge.preenchido {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.rascunho {
  background: #fef3c7;
  color: #92400e;
}

/* Creditos */
.creditos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.plano-card {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  border: 2px solid var(--border);
  transition: transform 0.2s;
}

.plano-card:hover {
  transform: translateY(-5px);
}

.plano-card.featured {
  border-color: var(--primary);
}

.plano-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.plano-header h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.preco {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.preco span {
  font-size: 1rem;
  font-weight: 400;
}

.plano-features {
  list-style: none;
  margin: 25px 0;
  text-align: left;
}

.plano-features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.plano-features li:last-child {
  border-bottom: none;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-lg {
  max-width: 1000px;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 25px;
  border-top: 1px solid var(--border);
}

/* Contrato Preview */
.contrato-preview {
  background: white;
  padding: 40px;
  font-family: 'Times New Roman', serif;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 60vh;
  overflow-y: auto;
  text-align: justify;
}

.contrato-preview strong {
  font-weight: bold;
}

.contrato-preview h1,
.contrato-preview h2 {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  margin: 20px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contrato-preview .clausula {
  margin: 15px 0;
  text-align: justify;
}

.contrato-preview .assinatura {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.contrato-preview .bloco-assinatura {
  flex: 1;
  text-align: center;
  border-top: 1px solid #000;
  padding-top: 10px;
  margin-top: 60px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Error Message */
.error-message {
  color: var(--danger);
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: none;
}

.error-message.show {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: block;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .menu-toggle {
    display: flex !important;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }

  .modal-content {
    width: 95%;
    margin: 10px;
  }
}

/* Utilities */
.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.text-center {
  text-align: center;
}

.resultados-busca {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 250px;
  overflow-y: auto;
}

.resultado-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.resultado-item:hover {
  background: #f1f5f9;
}

.resultado-item:last-child {
  border-bottom: none;
}

.resultado-item .nome {
  font-weight: 600;
  color: var(--text-primary);
}

.resultado-item .info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Footer */
.site-footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #94a3b8;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
}

.site-footer a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #93c5fd;
}

.site-footer .footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 0.5rem;
}

.site-footer .footer-divider {
  width: 60px;
  height: 2px;
  background: #2563eb;
  margin: 0.75rem auto;
  border-radius: 1px;
}

.site-footer .footer-copy {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}
