:root {
  --bg: #0f1724;
  --card: #0b1220;
  --accent: #4f46e5;
  --muted: #94a3b8;
  --white: #e6eef8;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #071124 0%, #071430 100%);
  color: var(--white);
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar-brand {
  font-weight: 700;
  font-size: 18px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: #334155;
}

.btn-success {
  background: var(--success);
}

.btn-warning {
  background: var(--warning);
}

.btn-error {
  background: var(--error);
}

.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 60px 0;
}

.hero h1 {
  font-size: 42px;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.hero p {
  color: var(--muted);
  margin: 0 0 24px 0;
  font-size: 16px;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.plan-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s;
}

.plan-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.plan-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.plan-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 32px;
  margin: 12px 0 4px 0;
}

.plan-period {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px 0;
}

.plan-description {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 16px 0;
}

.plan-features {
  margin: 12px 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}
.plan-features li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.03);
}
.plan-line {
  height: 1px;
  background: rgba(255,255,255,0.04);
  margin: 12px 0;
}
.plan-recomendado {
  font-size: 13px;
  color: #fbbf24;
  margin-top: 8px;
  font-weight: 600;
}

.small {
  font-size: 13px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

/* Workstation */
.workspace {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 24px;
  margin-top: 20px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 16px;
}

.workspace-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workspace-user-info strong {
  font-size: 16px;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-content {
  margin-top: 16px;
}

.status-item {
  background: rgba(255, 255, 255, 0.01);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-label {
  font-size: 14px;
  color: var(--muted);
}

.status-value {
  font-weight: 700;
  color: var(--white);
}

.pages-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
}

.pages-list li {
  background: rgba(255, 255, 255, 0.01);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Builder */
.builder-container {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.builder-container.active {
  display: block;
}

.builder-content {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  color: #111;
  display: flex;
  height: calc(100vh - 40px);
}

.builder-left {
  width: 250px;
  background: #f3f4f6;
  padding: 16px;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
}

.builder-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.builder-header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.builder-header input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.canvas {
  flex: 1;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  padding: 16px;
  background: white;
  overflow-y: auto;
  margin-bottom: 16px;
}

/* Tabs and page files bar sizing for builder */
#tabsBar {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  align-items: center;
  min-height: 56px;
}

#tabsBar .tab-item {
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  min-height: 36px;
}

#pageFilesBar {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 12px 0;
  margin-bottom: 10px;
  align-items: center;
  min-height: 56px;
}

#pageFilesBar .btn {
  padding: 8px 12px;
  font-size: 13px;
  height: 36px;
  display: inline-flex;
  align-items: center;
}

.component-block {
  background: #e0e7ff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: grab;
  font-weight: 500;
  color: #4338ca;
  user-select: none;
}

.component-block:active {
  cursor: grabbing;
}

.css-section {
  margin-top: 12px;
}

.css-section label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.css-section textarea {
  width: 100%;
  height: 100px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  resize: vertical;
}

/* Files modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  padding: 20px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
  width: 100%;
  color: #111;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
}

.files-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.files-list li {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.files-list li:last-child {
  border-bottom: none;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.file-slug {
  font-size: 12px;
  color: #888;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-actions a {
  padding: 4px 8px;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
}

.modal-footer {
  margin-top: 16px;
  text-align: right;
}

/* Auth pages */
.auth-container {
  max-width: 400px;
  margin: 60px auto;
  background: rgba(255, 255, 255, 0.03);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-container h1 {
  margin: 0 0 24px 0;
  font-size: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 14px;
}

.form-group input::placeholder {
  color: var(--muted);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.password-wrapper {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 40px !important;
}

.password-wrapper input {
  width: 100% !important;
  height: 100% !important;
  padding: 10px 12px !important;
  padding-right: 50px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: white !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
}

.password-wrapper input::placeholder {
  color: var(--muted);
}

.password-wrapper input:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.password-toggle-btn {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border: none !important;
  cursor: pointer !important;
  font-size: 18px !important;
  padding: 0 !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  color: var(--muted) !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  z-index: 10 !important;
}

.password-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

.password-toggle-btn:active {
  transform: translateY(-50%) scale(0.95);
  background: rgba(255, 255, 255, 0.3);
}

.form-group .password-wrapper {
  width: 100%;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border-left: 2px solid #ef4444;
  padding: 12px;
  border-radius: 4px;
  color: #fca5a5;
  margin-bottom: 16px;
  font-size: 14px;
}

.success-message {
  background: rgba(16, 185, 129, 0.1);
  border-left: 2px solid #10b981;
  padding: 12px;
  border-radius: 4px;
  color: #86efac;
  margin-bottom: 16px;
  font-size: 14px;
}
