/* ═══════════════════════════════════════════════════════
   TEXTFORMATTER · SHARED TOOL PAGE STYLES
═══════════════════════════════════════════════════════ */

/* ─── Tool Hero ──────────────────────────────────────── */
.tool-hero {
  padding: 72px 0 56px;
  background: var(--ivory);
  position: relative;
  overflow: hidden;
}
.tool-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--ivory-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--ivory-3) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .45;
  mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, black 30%, transparent 100%);
}
.tool-hero-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.tool-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px;
  background: var(--sage-pale);
  color: var(--sage);
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  margin-bottom: 20px;
  border: 1px solid var(--sage-light);
}
.tool-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 16px;
  max-width: 760px;
}
.tool-hero h1 em { font-style: italic; color: var(--sage); }
.tool-hero p {
  font-size: clamp(.95rem, 2vw, 1.1rem);
  color: var(--ink-3);
  max-width: 560px;
  line-height: 1.65;
}

/* ─── Tool App Section ───────────────────────────────── */
.tool-app-section {
  padding: 64px 0 80px;
  background: var(--ivory-2);
  border-top: 1px solid var(--ivory-3);
}

/* ─── Tool Card (main interactive box) ──────────────── */
.tool-card {
  background: var(--white);
  border: 1px solid var(--ivory-3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.tool-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--ivory);
  border-bottom: 1px solid var(--ivory-3);
  flex-wrap: wrap; gap: 10px;
}
.tool-card-title {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-3);
}
.tool-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Textarea / Code Area ───────────────────────────── */
.tool-textarea {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: .875rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  border: none;
  outline: none;
  resize: vertical;
  display: block;
}
.tool-textarea::placeholder { color: var(--ink-3); opacity: .55; }
.tool-textarea.output-area { background: var(--ivory); cursor: default; }

.tool-footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: var(--ivory);
  border-top: 1px solid var(--ivory-3);
  flex-wrap: wrap; gap: 8px;
}
.tool-stat {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--ink-3);
}

/* ─── Action Buttons ─────────────────────────────────── */
.act-btn {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid var(--ivory-3);
  background: var(--ivory);
  color: var(--ink-2);
  transition: all var(--transition);
  white-space: nowrap;
}
.act-btn:hover { background: var(--ivory-2); border-color: var(--ink-3); }
.act-btn.primary {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}
.act-btn.primary:hover { background: var(--sage); border-color: var(--sage); }
.act-btn.danger:hover { background: var(--red-pale); color: var(--red-soft); border-color: var(--red-soft); }
.act-btn.success { background: var(--sage-pale); color: var(--sage); border-color: var(--sage); }

/* ─── Section divider strip ─────────────────────────── */
.section-strip {
  width: 48px; height: 3px;
  background: var(--sage);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.section-strip.left { margin: 0 0 20px; }

/* ─── How-To Section ─────────────────────────────────── */
.howto-section { padding: 80px 0; background: var(--ivory); }
.howto-steps { display: flex; flex-direction: column; gap: 32px; margin-top: 40px; }
.howto-step {
  display: flex; gap: 24px; align-items: flex-start;
}
.howto-num {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: var(--ink);
  color: var(--ivory);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.howto-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}
.howto-body p { font-size: .92rem; color: var(--ink-3); }

/* ─── Description Section ────────────────────────────── */
.desc-section { padding: 80px 0; background: var(--ivory-2); }
.desc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.desc-card {
  background: var(--white);
  border: 1px solid var(--ivory-3);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.desc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.desc-card-icon {
  font-size: 1.5rem; margin-bottom: 14px;
}
.desc-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}
.desc-card p { font-size: .88rem; color: var(--ink-3); }

/* ─── FAQ Section ────────────────────────────────────── */
.tool-faq-section { padding: 80px 0; background: var(--ivory); }
.tool-faq-list { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; max-width: 860px; margin-left: auto; margin-right: auto; }
.faq-item {
  background: var(--white);
  border: 1px solid var(--ivory-3);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-q {
  width: 100%; text-align: left;
  padding: 16px 20px;
  font-weight: 600; font-size: .93rem;
  color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  transition: background var(--transition);
}
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--sage); flex-shrink: 0; transition: transform var(--transition); }
.faq-q[aria-expanded="true"] { background: var(--ivory); }
.faq-q[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-a.open { max-height: 400px; }
.faq-a p { padding: 0 20px 16px; font-size: .9rem; color: var(--ink-3); }

/* ─── Notification Toast ─────────────────────────────── */
.tool-notif {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-weight: 500;
  margin-top: 14px;
  min-height: 40px;
  display: flex; align-items: center;
  transition: all var(--transition);
}
.tool-notif.success { background: var(--sage-pale); color: var(--sage); }
.tool-notif.error   { background: var(--red-pale);  color: var(--red-soft); }
.tool-notif.info    { background: var(--amber-pale); color: var(--amber); }
.tool-notif:empty   { display: none; }

/* ─── Tool CTA ────────────────────────────────────────── */
.tool-cta-section { padding: 64px 0; background: var(--ivory-2); }
.tool-cta-inner {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 52px 40px;
  text-align: center;
  position: relative; overflow: hidden;
}
.tool-cta-inner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 40%, rgba(90,122,95,.3) 0%, transparent 60%);
  pointer-events: none;
}
.tool-cta-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700; color: var(--ivory);
  margin-bottom: 12px; position: relative;
}
.tool-cta-inner p {
  color: var(--ivory-3); margin-bottom: 28px;
  font-size: 1rem; max-width: 440px;
  margin-left: auto; margin-right: auto; position: relative;
}
.tool-cta-inner .act-btn.primary {
  background: var(--sage); border-color: var(--sage);
  padding: 13px 32px; font-size: 1rem;
  box-shadow: 0 6px 20px rgba(90,122,95,.35);
  position: relative;
}

/* ─── Inline code ────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  background: var(--ivory-2);
  border: 1px solid var(--ivory-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .85em;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 700px) {
  .tool-hero { padding: 52px 0 40px; }
  .tool-app-section { padding: 40px 0 60px; }
  .howto-section, .desc-section, .tool-faq-section { padding: 60px 0; }
  .tool-card-header { flex-direction: column; align-items: flex-start; }
  .howto-step { flex-direction: column; gap: 12px; }
  .howto-num { width: 38px; height: 38px; font-size: .95rem; }
  .tool-cta-inner { padding: 36px 20px; }
}
