/* AI Humanizer — Stylesheet (part 1) */
:root {
  --bg: #0a0a0a;
  --bg-surface: #141414;
  --bg-surface-hover: #1c1c1c;
  --border: #272727;
  --border-focus: #8b5cf6;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.35);
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.app-container { width: 100%; max-width: 100%; padding: 0; }
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.logo svg rect { fill: #0a0a0a; }
.logo span { font-weight: 800; }
.btn-settings {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-settings:hover { border-color: var(--accent); color: var(--accent); background: rgba(139, 92, 246, 0.08); }

.btn-install {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border: none;
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-install:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4); }
.btn-install:active { transform: translateY(0); }

/* Settings Profile Panel */
.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4);
}
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.profile-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.profile-id {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}
.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.stat-value.plan-free { color: var(--text-secondary); }
.stat-value.plan-pro { color: var(--success); }
.engine-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--success);
  border-radius: 50%;
  margin-right: 0.5rem;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.app-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  min-height: calc(100vh - 60px);
}
.btn-humanize {
  width: 100%;
  margin-top: 1.25rem;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border: none;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-humanize:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4); }
.btn-humanize:active { transform: translateY(0); }
.btn-humanize:disabled { opacity: 0.6; cursor: not-allowed; transform: none; filter: none; }
.btn-icon { font-size: 1.2rem; }
.input-footer {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.char-count, .tone-hint { font-size: 0.8rem; color: var(--text-muted); }
.output-wrapper { position: relative; width: 100%; min-height: 260px; margin-bottom: 1rem; }
.output-wrapper textarea { min-height: 260px; padding-right: 3.5rem; }
.btn-copy {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-copy:hover { border-color: var(--border-focus); color: var(--text-primary); background: var(--bg-surface); }
.btn-copy:disabled { opacity: 0.5; cursor: not-allowed; }
.output-footer { display: flex; align-items: center; gap: 0.5rem; }
.status-indicator { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.status-indicator.processing .status-dot { background: var(--warning); animation: none; }
.status-indicator.success .status-dot { background: var(--success); animation: none; }
.typing-cursor { display: inline-block; width: 8px; background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.panel-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.panel-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.panel-badge--output {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent);
  border-color: rgba(139, 92, 246, 0.25);
}
textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 260px;
  transition: var(--transition);
  outline: none;
}
textarea::placeholder { color: var(--text-muted); }
textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.filters-row { margin-top: 1rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.filters-label { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-chip {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--text-muted); color: var(--text-primary); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-glow); }

/* Settings Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal[aria-hidden="false"] { opacity: 1; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal[aria-hidden="false"] .modal-card { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.btn-close, .btn-close-paywall {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-close:hover, .btn-close-paywall:hover { color: var(--text-primary); background: var(--bg-surface-hover); }
.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.modal-desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.setting-item { display: flex; flex-direction: column; gap: 0.5rem; }
.setting-label { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.setting-label-note { font-weight: 400; font-size: 0.85rem; color: var(--text-muted); margin-left: 0.5rem; }
.setting-input {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.setting-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
.setting-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.setting-item--toggle { flex-direction: row; justify-content: space-between; align-items: center; }
.setting-toggle {
  width: 44px;
  height: 24px;
  appearance: none;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.setting-toggle:checked { background: var(--accent); }
.setting-toggle:checked::before { transform: translateX(20px); }
.setting-toggle::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.setting-toggle-label { font-size: 0.85rem; color: var(--text-secondary); margin-right: 0.5rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  gap: 0.75rem;
}
.btn-secondary {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--border-focus); color: var(--accent); }

/* Paywall Modal */
.paywall-backdrop {
  background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.18), transparent 70%), rgba(0, 0, 0, 0.75);
}
.paywall-card { max-width: 640px; max-height: 92vh; text-align: center; }
.paywall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.paywall-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.paywall-header h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); }
.paywall-subtitle { font-size: 0.95rem; color: var(--text-secondary); margin-top: 0.25rem; }
.paywall-body { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.plan-cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.plan-card {
  position: relative;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
}
.plan-card:hover { border-color: var(--border-focus); transform: translateY(-2px); }
.plan-card--monthly { border-color: var(--accent); background: linear-gradient(180deg, rgba(139, 92, 246, 0.08), rgba(139, 92, 246, 0.02)); }
.plan-card--yearly { border-color: var(--accent); background: linear-gradient(180deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.04)); z-index: 2; }
.plan-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  color: #fff;
  background: var(--text-muted);
}
.plan-tag--best { background: linear-gradient(135deg, var(--accent), #7c3aed); box-shadow: 0 0 15px var(--accent-glow); }
.plan-name { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }
.plan-price { font-size: 2.2rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.plan-period { font-size: 0.85rem; color: var(--text-muted); margin-top: -0.25rem; }
.plan-features { list-style: none; margin: 1rem 0; width: 100%; text-align: left; }
.plan-features li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--text-secondary); }
.plan-features .check { font-weight: 800; }
.plan-features li .check { color: var(--success); }
.plan-card--free .plan-features li .check { color: var(--text-muted); }
.plan-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.plan-btn--monthly { background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4); }
.plan-btn--monthly:hover { filter: brightness(1.1); }
.plan-btn--yearly { background: var(--bg-surface-hover); border: 2px solid var(--accent); color: var(--accent); }
.plan-btn--yearly:hover { background: rgba(139, 92, 246, 0.15); color: var(--accent-hover); }
.plan-btn--free { background: var(--bg-surface-hover); border: 1px solid var(--border); color: var(--text-muted); }
.plan-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.paywall-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Responsive */
@media (min-width: 768px) {
  .app-main { flex-direction: row; padding: 2rem; }
  .panel { flex: 1; padding: 2rem; }
  .plan-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .app-header { padding: 0.9rem 1rem; }
  .logo { font-size: 1.15rem; }
  .panel { padding: 1.25rem; }
  textarea { min-height: 200px; }
  .paywall-body { padding: 1.5rem; }
  .plan-price { font-size: 1.8rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus visible */
button:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

/* Footer */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.footer-container {
  max-width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}
.footer-link:hover {
  color: var(--accent);
  background: rgba(139, 92, 246, 0.08);
}

/* Legal Modal extensions */
.legal-modal-card {
  max-width: 600px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.legal-body {
  line-height: 1.7;
}
.legal-body p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}
.legal-body p:last-child {
  margin-bottom: 0;
}
.contact-body .contact-email {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
}

/* Responsive footer */
@media (min-width: 640px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
  }
  .footer-nav {
    justify-content: flex-end;
    flex: 1;
  }
}