

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

:root {
  --bg:          #0a0a0f;
  --bg2:         #111118;
  --bg3:         #18181f;
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(255,255,255,0.12);
  --text:        #f0f0f8;
  --text2:       #9898b8;
  --text3:       #6060808;
  --purple:      #7C3AED;
  --purple2:     #6D28D9;
  --indigo:      #4F46E5;
  --accent:      #a78bfa;
  --green:       #22c55e;
  --red:         #ef4444;
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   8px;
  --shadow:      0 20px 60px rgba(0,0,0,0.5);
  --glass:       rgba(255,255,255,0.03);
  --glass-border:rgba(255,255,255,0.07);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== Background Blobs ===== */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #7C3AED, transparent 70%);
  top: -200px; left: -200px;
}
.blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #4F46E5, transparent 70%);
  top: 30%; right: -150px;
}
.blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #0ea5e9, transparent 70%);
  bottom: 0; left: 30%;
  opacity: 0.08;
}

/* ===== Container ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.header-nav {
  display: flex;
  gap: 4px;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(124,58,237,0.15);
  color: var(--accent);
}

/* ===== Hero ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-block;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.gradient-text {
  background: linear-gradient(135deg, #7C3AED, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 16px;
  color: var(--text2);
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.7;
}
.hero-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 40px;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(10px);
  min-width: 180px;
}
.hero-card:hover {
  border-color: rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.08);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(124,58,237,0.15);
}
.hero-card-icon { font-size: 36px; margin-bottom: 10px; }
.hero-card-label {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.hero-card-sub { font-size: 12px; color: var(--text2); }

/* ===== Tool Tabs ===== */
.main-tool { padding: 0 0 80px; position: relative; z-index: 1; }

.tool-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
  margin-bottom: 32px;
}
.tool-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--text2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.tool-tab:hover { color: var(--text); }
.tool-tab.active {
  background: linear-gradient(135deg, var(--purple), var(--indigo));
  color: #fff;
  box-shadow: 0 4px 15px rgba(124,58,237,0.35);
}

/* ===== Tool Sections ===== */
.tool-section { display: none; }
.tool-section.active { display: block; }

/* ===== Cards / Panels ===== */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { opacity: 0.7; }

/* ===== Drop Zone ===== */
.drop-zone {
  border: 2px dashed rgba(124,58,237,0.3);
  border-radius: var(--radius-sm);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  background: rgba(124,58,237,0.03);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--purple);
  background: rgba(124,58,237,0.08);
}
.drop-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-icon {
  width: 60px; height: 60px;
  background: rgba(124,58,237,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}
.drop-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.drop-title span { color: var(--accent); }
.drop-sub { font-size: 13px; color: var(--text2); }

/* File chip */
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  color: #86efac;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  margin-top: 14px;
}
.file-chip .chip-icon { font-size: 14px; }
.file-chip .chip-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  line-height: 1;
  transition: opacity 0.15s;
}
.file-chip .chip-remove:hover { opacity: 1; }

/* ===== Form Controls ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-1 { grid-template-columns: 1fr; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-group input[type=text],
.form-group select,
.form-group textarea {
  width: 100%;
  height: 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xs);
  padding: 0 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  min-height: 70px;
}
.form-group input[type=text]:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(124,58,237,0.6);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.form-group select { cursor: pointer; }
.form-group select option { background: var(--bg2); }

.form-group input[type=color] {
  width: 100%;
  height: 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xs);
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
}

/* Slider row */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.slider-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  width: 100px;
  flex-shrink: 0;
}
.slider-row input[type=range] {
  flex: 1;
  accent-color: var(--purple);
  cursor: pointer;
  height: 4px;
}
.slider-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Position Grid */
.position-section {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 4px;
}
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 4px;
}
.pos-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  font-size: 14px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.pos-btn:hover { border-color: var(--purple); color: var(--accent); }
.pos-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.position-info {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
  padding-top: 2px;
}
.position-info strong { color: var(--accent); display: block; margin-bottom: 2px; }

/* Watermark Type Tabs */
.type-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.type-tab {
  flex: 1;
  height: 38px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.type-tab:hover { color: var(--text); border-color: rgba(124,58,237,0.4); }
.type-tab.active {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.5);
  color: var(--accent);
}
.type-panel { display: none; }
.type-panel.active { display: block; }

/* ===== Preview ===== */
.preview-box {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: repeating-conic-gradient(rgba(255,255,255,0.04) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px;
  position: relative;
}
.preview-box canvas { width: 100%; display: block; max-height: 500px; object-fit: contain; }
.preview-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}

/* PDF Preview */
.pdf-preview-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.pdf-preview-box.has-file {
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.04);
}
.pdf-icon-big { font-size: 52px; }
.pdf-info { font-size: 14px; font-weight: 500; }
.pdf-info-sub { font-size: 12px; color: var(--text2); }
.pdf-pages-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: var(--accent);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ===== Buttons ===== */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  padding: 0 20px;
  text-decoration: none;
}
.btn-ghost {
  background: rgba(255,255,255,0.06);
  border-color: var(--border2);
  color: var(--text);
  flex: 0 0 auto;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--indigo));
  color: #fff;
  flex: 1;
  box-shadow: 0 4px 20px rgba(124,58,237,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #6D28D9, #4338CA);
  box-shadow: 0 6px 25px rgba(124,58,237,0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Loading spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: block; }
.btn.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Progress bar */
.progress-wrap {
  margin-top: 14px;
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--indigo));
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}
.progress-text {
  font-size: 12px;
  color: var(--text2);
  margin-top: 6px;
  text-align: center;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 24px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: rgba(34,197,94,0.4); color: #86efac; }
.toast.error { border-color: rgba(239,68,68,0.4); color: #fca5a5; }

/* ===== Info box ===== */
.info-box {
  background: rgba(79,70,229,0.08);
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  font-size: 13px;
  color: #a5b4fc;
  margin-top: 10px;
  line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  position: relative;
  z-index: 1;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero { padding: 50px 0 40px; }
  .hero-cards { flex-direction: column; align-items: center; }
  .hero-card { width: 100%; max-width: 300px; padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
  .btn-row { flex-direction: column; }
  .header-nav { display: none; }
}
