/* =========================================================
   niDar Tools — Base64 Encoder & Decoder
   Tool #11 — Original Professional UI
   ========================================================= */

:root {
  --primary: #008f3c;
  --primary-dark: #006f2f;
  --primary-light: #e6f7ec;

  --text: #172019;
  --muted: #66716a;

  --bg: #f5faf7;
  --card: #ffffff;
  --border: #d9e4dd;

  --success: #087f35;
  --danger: #c62828;

  --shadow: 0 12px 35px rgba(0, 90, 45, 0.08);
  --shadow-hover: 0 18px 45px rgba(0, 90, 45, 0.13);

  --radius: 24px;
  --radius-small: 16px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: var(--text);
  background:
    radial-gradient(
      circle at top,
      #e9f9ef 0,
      #f5faf7 36%,
      #f7faf8 100%
    );

  line-height: 1.6;
}

button,
textarea,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}


/* =========================================================
   MAIN PAGE
   ========================================================= */

.base64-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 80px;
}


/* =========================================================
   HERO
   ========================================================= */

.tool-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 42px;
}

.tool-badge,
.section-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 18px;

  border: 1px solid #c7e6d1;
  border-radius: 999px;

  background: #e9f8ed;
  color: var(--primary-dark);

  font-size: 0.95rem;
  font-weight: 700;
}

.tool-hero h1 {
  margin: 20px 0 14px;

  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.045em;

  color: var(--text);
}

.tool-hero h1::after {
  content: "";
  display: block;

  width: 90px;
  height: 5px;

  margin: 18px auto 0;

  border-radius: 99px;
  background: var(--primary);
}

.tool-hero p {
  max-width: 760px;
  margin: 20px auto 0;

  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}


/* =========================================================
   HERO FEATURE PILLS
   ========================================================= */

.hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;

  margin-top: 26px;
}

.hero-features span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;
  padding: 8px 16px;

  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;

  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;

  box-shadow: 0 5px 18px rgba(0, 70, 35, 0.05);
}


/* =========================================================
   MAIN WORKSPACE
   ========================================================= */

.base64-workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
}


/* =========================================================
   TOOL CARD
   ========================================================= */

.tool-card,
.quick-actions-card,
.info-card,
.privacy-notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.tool-card {
  padding: clamp(22px, 4vw, 36px);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}


/* =========================================================
   SECTION HEADING
   ========================================================= */

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 18px;

  margin-bottom: 28px;
}

.step-number {
  flex: 0 0 54px;

  width: 54px;
  height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background:
    linear-gradient(
      145deg,
      #00a447,
      #007c34
    );

  color: #ffffff;

  font-size: 1.35rem;
  font-weight: 800;

  box-shadow:
    0 10px 24px rgba(0, 143, 60, 0.22);
}

.section-heading h2 {
  margin: 0 0 5px;

  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.section-heading p {
  margin: 0;

  color: var(--muted);
  font-size: 0.98rem;
}


/* =========================================================
   FORM FIELDS
   ========================================================= */

.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;

  margin-bottom: 9px;

  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.field-group textarea {
  width: 100%;
  min-height: 190px;

  display: block;

  padding: 17px 18px;

  border: 1.5px solid #cfdad3;
  border-radius: 17px;

  background: #fbfdfc;
  color: var(--text);

  outline: none;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 0.96rem;
  line-height: 1.65;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.field-group textarea::placeholder {
  color: #9aa59f;
}

.field-group textarea:focus {
  border-color: var(--primary);

  background: #ffffff;

  box-shadow:
    0 0 0 4px rgba(0, 143, 60, 0.10);
}


/* =========================================================
   ACTION ROW
   ========================================================= */

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.primary-btn,
.secondary-btn,
.option-btn,
.cta-btn {
  min-height: 52px;

  border-radius: 15px;

  padding: 12px 22px;

  font-weight: 750;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.primary-btn {
  flex: 1 1 250px;

  border: 1px solid var(--primary);
  background:
    linear-gradient(
      135deg,
      #00a947,
      #008f3c
    );

  color: #ffffff;

  box-shadow:
    0 9px 22px rgba(0, 143, 60, 0.20);
}

.primary-btn:hover {
  transform: translateY(-2px);

  background:
    linear-gradient(
      135deg,
      #00b34c,
      #007c34
    );

  box-shadow:
    0 13px 28px rgba(0, 143, 60, 0.25);
}

.secondary-btn {
  flex: 0 1 auto;

  border: 1px solid #cfdad3;
  background: #ffffff;

  color: var(--text);
}

.secondary-btn:hover {
  transform: translateY(-2px);

  border-color: #9ec9ad;
  background: #f1faf4;
}


/* =========================================================
   RESULT BOX
   ========================================================= */

.result-box {
  margin-top: 24px;

  padding: 20px;

  border: 1px solid #c8e3d0;
  border-radius: 20px;

  background:
    linear-gradient(
      145deg,
      #f2fcf5,
      #ffffff
    );

  animation: resultIn 0.3s ease;
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 12px;

  font-weight: 750;
}

.result-status {
  color: var(--success);
  font-size: 0.85rem;
}

.result-box textarea {
  width: 100%;
  min-height: 150px;

  padding: 15px;

  border: 1px solid #cbd9d0;
  border-radius: 14px;

  background: #ffffff;
  color: #17301f;

  outline: none;

  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;

  font-size: 0.9rem;
  line-height: 1.6;
}

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

  margin-top: 14px;
}


/* =========================================================
   QUICK ACTIONS
   ========================================================= */

.quick-actions-card {
  padding: clamp(22px, 4vw, 32px);
}

.quick-actions-card .section-heading {
  margin-bottom: 22px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.option-btn {
  width: 100%;

  border: 1px solid #cfdad3;
  background: #ffffff;

  color: var(--text);
}

.option-btn:hover {
  transform: translateY(-2px);

  border-color: #9bcaaa;
  background: var(--primary-light);

  color: var(--primary-dark);
}


/* =========================================================
   INFO CARD
   ========================================================= */

.info-card,
.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 18px;

  padding: 25px;
}

.info-card {
  background:
    linear-gradient(
      135deg,
      #ffffff,
      #f8fcf9
    );
}

.info-icon,
.privacy-icon {
  flex: 0 0 52px;

  width: 52px;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 16px;

  background: var(--primary-light);

  font-size: 1.55rem;
}

.info-card h3,
.privacy-notice h3 {
  margin: 0 0 6px;

  font-size: 1.2rem;
}

.info-card p,
.privacy-notice p {
  margin: 0;

  color: var(--muted);
}


/* =========================================================
   PRIVACY
   ========================================================= */

.privacy-notice {
  border-color: #bfe0c9;

  background:
    linear-gradient(
      135deg,
      #eaf9ee,
      #f7fcf8
    );
}


/* =========================================================
   HOW IT WORKS
   ========================================================= */

.how-section,
.use-cases-section,
.reference-section {
  margin-top: 82px;

  text-align: center;
}

.how-section h2,
.use-cases-section h2,
.reference-section h2 {
  margin: 17px 0 10px;

  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.section-description {
  max-width: 720px;

  margin: 0 auto 34px;

  color: var(--muted);

  font-size: 1.08rem;
}


/* =========================================================
   HOW CARDS
   ========================================================= */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;

  margin-top: 34px;

  text-align: left;
}

.how-card {
  padding: 28px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: #ffffff;

  box-shadow: var(--shadow);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.how-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.how-number {
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 20px;

  border-radius: 14px;

  background: var(--primary-light);
  color: var(--primary-dark);

  font-size: 1.15rem;
  font-weight: 800;
}

.how-card h3 {
  margin: 0 0 8px;

  font-size: 1.2rem;
}

.how-card p {
  margin: 0;

  color: var(--muted);
}


/* =========================================================
   USE CASES
   ========================================================= */

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;

  margin-top: 34px;

  text-align: left;
}

.use-case-card {
  padding: 25px;

  border: 1px solid var(--border);
  border-radius: 20px;

  background: #ffffff;

  box-shadow: 0 8px 25px rgba(0, 70, 35, 0.06);
}

.use-case-icon {
  width: 52px;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 17px;

  border-radius: 15px;

  background: var(--primary-light);

  font-size: 1.5rem;
}

.use-case-card h3 {
  margin: 0 0 7px;

  font-size: 1.12rem;
}

.use-case-card p {
  margin: 0;

  color: var(--muted);
  font-size: 0.94rem;
}


/* =========================================================
   REFERENCE
   ========================================================= */

.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;

  margin-top: 34px;

  text-align: left;
}

.reference-card {
  padding: 25px;

  border: 1px solid var(--border);
  border-radius: 20px;

  background: #ffffff;

  box-shadow: 0 8px 25px rgba(0, 70, 35, 0.05);
}

.reference-card h3 {
  margin: 0 0 8px;

  font-size: 1.15rem;
}

.reference-card p {
  margin: 0;

  color: var(--muted);
}


/* =========================================================
   FINAL CTA
   ========================================================= */

.final-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;

  margin-top: 80px;
  padding: 34px;

  border: 1px solid #b8dec3;
  border-radius: 26px;

  background:
    linear-gradient(
      135deg,
      #e5f7ea,
      #f7fcf8
    );

  box-shadow: var(--shadow);
}

.final-cta .section-label {
  margin-bottom: 12px;
}

.final-cta h2 {
  margin: 0 0 7px;

  font-size: clamp(1.65rem, 4vw, 2.2rem);
}

.final-cta p {
  margin: 0;

  color: var(--muted);
}

.cta-btn {
  flex: 0 0 auto;

  border: 1px solid var(--primary);

  background:
    linear-gradient(
      135deg,
      #00a947,
      #008f3c
    );

  color: #ffffff;

  box-shadow:
    0 10px 25px rgba(0, 143, 60, 0.2);
}

.cta-btn:hover {
  transform: translateY(-2px);

  box-shadow:
    0 14px 30px rgba(0, 143, 60, 0.25);
}


/* =========================================================
   HIDDEN ATTRIBUTE
   ========================================================= */

[hidden] {
  display: none !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 950px) {

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .use-cases-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 680px) {

  .base64-page {
    width: min(100% - 20px, 620px);
    padding-top: 28px;
    padding-bottom: 55px;
  }

  .tool-hero {
    margin-bottom: 28px;
  }

  .tool-hero h1 {
    font-size: 2.25rem;
  }

  .tool-hero p {
    font-size: 1rem;
  }

  .hero-features {
    gap: 8px;
  }

  .hero-features span {
    font-size: 0.84rem;
    padding: 7px 12px;
  }

  .tool-card {
    padding: 20px 16px;
    border-radius: 21px;
  }

  .quick-actions-card {
    padding: 20px 16px;
  }

  .section-heading {
    gap: 13px;
  }

  .step-number {
    flex-basis: 46px;

    width: 46px;
    height: 46px;

    font-size: 1.1rem;
  }

  .section-heading h2 {
    font-size: 1.28rem;
  }

  .section-heading p {
    font-size: 0.9rem;
  }

  .field-group textarea {
    min-height: 165px;

    padding: 14px;

    font-size: 0.9rem;
  }

  .action-row {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
    flex: 1 1 auto;
  }

  .result-box {
    padding: 15px;
  }

  .result-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .secondary-btn {
    width: 100%;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .info-card,
  .privacy-notice {
    padding: 20px;
    gap: 13px;
  }

  .info-icon,
  .privacy-icon {
    flex-basis: 44px;

    width: 44px;
    height: 44px;

    font-size: 1.25rem;
  }

  .how-section,
  .use-cases-section,
  .reference-section {
    margin-top: 60px;
  }

  .how-section h2,
  .use-cases-section h2,
  .reference-section h2 {
    font-size: 2rem;
  }

  .steps-grid {
    gap: 14px;
  }

  .how-card {
    padding: 22px;
  }

  .use-cases-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .reference-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .final-cta {
    flex-direction: column;
    align-items: stretch;

    margin-top: 60px;
    padding: 25px 20px;
  }

  .cta-btn {
    width: 100%;
  }

}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 390px) {

  .base64-page {
    width: min(100% - 14px, 620px);
  }

  .tool-hero h1 {
    font-size: 2rem;
  }

  .tool-badge,
  .section-label {
    font-size: 0.82rem;
    padding: 8px 13px;
  }

  .hero-features span {
    width: 100%;
  }

  .tool-card {
    padding: 18px 13px;
  }

  .section-heading {
    gap: 10px;
  }

  .step-number {
    flex-basis: 42px;

    width: 42px;
    height: 42px;

    font-size: 1rem;
  }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(0, 143, 60, 0.22);
  outline-offset: 2px;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}
