/* =========================================================
   niDar Tools — Background Remover
   ========================================================= */

:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-light: #e8f5e9;
  --accent: #43a047;

  --bg: #f6f8f7;
  --card: #ffffff;
  --text: #17211b;
  --muted: #66736b;
  --border: #dfe7e1;

  --success: #2e7d32;
  --danger: #d32f2f;

  --shadow: 0 12px 35px rgba(30, 60, 40, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(46, 125, 50, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 45%, #f3f7f4 100%);
  color: var(--text);
  line-height: 1.6;
}

button, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, select:focus-visible {
  outline: 3px solid rgba(46, 125, 50, 0.25);
  outline-offset: 2px;
}

/* MAIN PAGE */
.background-remover-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 80px;
}

/* HERO */
.tool-hero {
  max-width: 820px;
  margin: 0 auto 42px;
  text-align: center;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 15px;
  border: 1px solid rgba(46, 125, 50, 0.18);
  border-radius: 999px;
  background: rgba(232, 245, 233, 0.85);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.tool-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -1.8px;
}

.tool-hero p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
}

/* UPLOAD */
.upload-section {
  margin-bottom: 28px;
}

.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 330px;
  padding: 45px 25px;
  border: 2px dashed rgba(46, 125, 50, 0.35);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 243, 0.9));
  box-shadow: var(--shadow);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.upload-zone:hover {
  border-color: rgba(46, 125, 50, 0.65);
  box-shadow: 0 16px 38px rgba(30, 60, 40, 0.1);
}

.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: var(--primary-light);
  font-size: 34px;
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.08);
}

.upload-zone h2 {
  margin: 0 0 7px;
  font-size: 25px;
  line-height: 1.2;
}

.upload-zone p {
  max-width: 560px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.upload-hint {
  display: block;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

/* BUTTONS */
.primary-btn, .secondary-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(46, 125, 50, 0.2);
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 11px 25px rgba(46, 125, 50, 0.25);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.secondary-btn:hover {
  border-color: rgba(46, 125, 50, 0.4);
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.large-btn {
  min-height: 52px;
  padding: 12px 22px;
}

/* WORKSPACE */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.step-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.panel-heading h2 {
  margin: 0 0 3px;
  font-size: 19px;
  line-height: 1.25;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* IMAGE PREVIEW */
.image-preview-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f3f5f4;
}

.image-preview-box img {
  display: block;
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.preview-placeholder {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* CHECKERBOARD */
.checkerboard {
  background-color: #f1f1f1;
  background-image:
    linear-gradient(45deg, #dedede 25%, transparent 25%),
    linear-gradient(-45deg, #dedede 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dedede 75%),
    linear-gradient(-45deg, transparent 75%, #dedede 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}

/* IMAGE INFO */
.image-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(246, 248, 247, 0.8);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.image-info span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* SETTINGS */
.settings-section {
  margin-top: 54px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 25px;
  text-align: center;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.section-heading h2 {
  margin: 0 0 7px;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.2;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.setting-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #ffffff;
}

.setting-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
}

.setting-card select {
  width: 100%;
  height: 45px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
}

/* PROCESS SECTION */
.process-section {
  margin-top: 32px;
}

.process-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.process-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-light);
  font-size: 26px;
}

.process-content {
  flex: 1;
  min-width: 200px;
}

.process-content h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.process-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* PROGRESS */
.progress-section {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--primary-light);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.2s ease;
}

.progress-section p {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* RESULT SECTION */
.result-section {
  margin-top: 32px;
  padding: 28px;
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.result-success {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.success-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 900;
}

.result-success h2 {
  margin: 0 0 3px;
  font-size: 19px;
}

.result-success p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

/* HOW TO USE */
.info-section {
  margin-top: 58px;
}

.info-heading {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.info-heading > span {
  font-size: 26px;
}

.info-heading h2 {
  margin: 0;
  font-size: 27px;
}

.info-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.info-step {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

.info-step > span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
}

.info-step h3 {
  margin: 9px 0 5px;
  font-size: 16px;
}

.info-step p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }
}
