
/* escola.fun — novas ferramentas gratuitas */
.free-tool-hero {
  padding-bottom:2.6rem;
}
.free-tool-grid .tool-card {
  position:relative;
}
.free-tool-badge {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.4rem .68rem;
  border-radius:999px;
  border:1px solid #acd8c3;
  background:#effaf4;
  color:#146c43;
  font-size:.76rem;
  font-weight:800;
}
.free-tool-shell {
  border:1px solid #d8e4ed;
  border-radius:1.1rem;
  padding:1.1rem;
  background:#fff;
  box-shadow:0 10px 32px rgba(16,42,67,.05);
}
.free-drop {
  border:2px dashed #c7d8e5;
  border-radius:1rem;
  padding:1.8rem 1rem;
  text-align:center;
  background:#f9fbfd;
  cursor:pointer;
  transition:.18s ease;
}
.free-drop.is-over {
  border-color:#0d6efd;
  background:#eef6ff;
}
.free-drop i {
  display:block;
  font-size:2rem;
  color:#0d6efd;
  margin-bottom:.45rem;
}
.free-drop strong,
.free-drop span {
  display:block;
}
.free-drop span {
  color:#6d8191;
  font-size:.84rem;
  margin-top:.2rem;
}
.free-preview {
  min-height:300px;
  border:1px solid #dbe5ec;
  border-radius:1rem;
  background:#f6f9fb;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  padding:1rem;
}
.free-preview img,
.free-preview canvas {
  display:block;
  max-width:100%;
  max-height:70vh;
  object-fit:contain;
}
.free-file-chip {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  border:1px solid #dbe5ec;
  border-radius:.85rem;
  padding:.7rem .8rem;
}
.free-file-chip > div {
  min-width:0;
}
.free-file-chip strong,
.free-file-chip span {
  display:block;
}
.free-file-chip strong {
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.free-file-chip span {
  color:#718393;
  font-size:.75rem;
}
.free-stat {
  border:1px solid #dbe5ec;
  border-radius:.9rem;
  background:#f9fbfd;
  padding:.8rem;
}
.free-stat strong {
  display:block;
  font-size:1.45rem;
  color:#102a43;
}
.free-stat span {
  display:block;
  color:#718393;
  font-size:.72rem;
  margin-top:.1rem;
}
.free-actions {
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
}
.free-info {
  display:flex;
  gap:.6rem;
  align-items:flex-start;
  padding:.8rem .9rem;
  border:1px solid #d9e6ef;
  border-radius:.9rem;
  background:#f8fbfd;
}
.free-info i { color:#18845a; }
.free-info strong,
.free-info span { display:block; }
.free-info span {
  color:#708392;
  font-size:.8rem;
  margin-top:.08rem;
}

/* Image annotator */
.image-editor-wrap {
  position:relative;
  overflow:auto;
  border:1px solid #d8e4ed;
  border-radius:1rem;
  background:#e9eff4;
  padding:1rem;
}
.image-editor-stage {
  position:relative;
  width:max-content;
  margin:auto;
  background:#fff;
  box-shadow:0 10px 28px rgba(16,42,67,.14);
}
.image-editor-stage > img {
  display:block;
  max-width:none;
}
.image-editor-stage .canvas-container {
  position:absolute !important;
  inset:0 !important;
}
.image-editor-toolbar {
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
  align-items:center;
  margin-bottom:.75rem;
  padding:.65rem;
  border:1px solid #d8e4ed;
  border-radius:.9rem;
  background:#fff;
  position:sticky;
  top:72px;
  z-index:20;
}
.image-editor-toolbar .btn.active {
  color:#fff;
  background:#0d6efd;
  border-color:#0d6efd;
}

/* Text tools */
.text-workbench textarea {
  min-height:330px;
  resize:vertical;
}
.text-stats {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.65rem;
}
.diff-output {
  border:1px solid #d8e4ed;
  border-radius:1rem;
  background:#fff;
  min-height:250px;
  padding:1rem;
  line-height:1.7;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.diff-add {
  background:#dff5e8;
  color:#135c39;
  text-decoration:none;
  padding:.04rem .08rem;
  border-radius:.2rem;
}
.diff-del {
  background:#fde3e6;
  color:#9e2634;
  text-decoration:line-through;
  padding:.04rem .08rem;
  border-radius:.2rem;
}

/* Bibliography */
.reference-result {
  border:1px solid #d8e4ed;
  border-radius:1rem;
  padding:1rem;
  background:#fbfcfd;
}
.reference-item {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  padding:.8rem 0;
  border-bottom:1px solid #e7edf2;
}
.reference-item:last-child {
  border-bottom:0;
}
.reference-text {
  min-width:0;
  line-height:1.55;
  padding-left:1.6rem;
  text-indent:-1.6rem;
}
.reference-actions {
  display:flex;
  gap:.35rem;
  flex:0 0 auto;
}

/* Flashcards */
.flashcard-layout {
  display:grid;
  grid-template-columns:minmax(260px,340px) minmax(0,1fr);
  gap:1rem;
}
.flashcard-list {
  border:1px solid #d8e4ed;
  border-radius:1rem;
  background:#fff;
  padding:.75rem;
  max-height:650px;
  overflow:auto;
}
.flashcard-list-item {
  border:1px solid #dce6ed;
  border-radius:.8rem;
  padding:.65rem;
  margin-bottom:.5rem;
  cursor:pointer;
}
.flashcard-list-item.active {
  border-color:#0d6efd;
  background:#f1f7ff;
}
.study-card {
  min-height:390px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  border:1px solid #d8e4ed;
  border-radius:1.2rem;
  background:#fff;
  box-shadow:0 14px 38px rgba(16,42,67,.08);
  padding:2rem;
  cursor:pointer;
  user-select:none;
}
.study-card-label {
  text-transform:uppercase;
  letter-spacing:.055em;
  color:#0d6efd;
  font-weight:850;
  font-size:.72rem;
}
.study-card-text {
  font-size:clamp(1.5rem,4vw,2.4rem);
  line-height:1.25;
  font-weight:800;
  color:#102a43;
  margin-top:.8rem;
}
.study-progress {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  color:#6f8292;
  font-size:.8rem;
}

@media (max-width:991.98px) {
  .flashcard-layout {
    grid-template-columns:1fr;
  }
  .flashcard-list {
    max-height:260px;
  }
}

@media (max-width:767.98px) {
  .free-tool-hero {
    padding-top:1.2rem;
  }
  .free-tool-shell {
    padding:.85rem;
  }
  .text-stats {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .image-editor-toolbar {
    top:66px;
    flex-wrap:wrap;
  }
  .image-editor-toolbar .btn {
    flex:1 1 auto;
  }
  .reference-item {
    flex-direction:column;
  }
  .reference-actions {
    justify-content:flex-end;
  }
}


/* ===== Flashcards v2 — experiência de estudo ===== */
.flashcards-hero {
  padding-bottom:2.2rem;
}

.flash-study-tabs {
  display:inline-flex;
  gap:.35rem;
  padding:.3rem;
  margin-bottom:1.2rem;
  border:1px solid #d8e4ed;
  border-radius:.9rem;
  background:#f5f8fa;
}

.flash-study-tab {
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.65rem 1rem;
  border:0;
  border-radius:.68rem;
  background:transparent;
  color:#526a7c;
  font-weight:800;
}

.flash-study-tab.active {
  color:#fff;
  background:#0d6efd;
  box-shadow:0 6px 18px rgba(13,110,253,.18);
}

.flash-tab-count {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.45rem;
  height:1.45rem;
  padding:0 .35rem;
  border-radius:999px;
  background:rgba(16,42,67,.08);
  font-size:.68rem;
}

.flash-study-tab.active .flash-tab-count {
  background:rgba(255,255,255,.18);
}

.flash-study-topbar {
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:1rem;
  margin-bottom:1rem;
}

.flash-study-progress-wrap {
  flex:1 1 auto;
  max-width:600px;
}

.flash-progress {
  height:.55rem;
  border-radius:999px;
  background:#e7eef4;
}

.flash-progress .progress-bar {
  border-radius:999px;
}

.flash-study-actions-top {
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.flash-study-actions-top .btn.active {
  color:#664d03;
  border-color:#ffca2c;
  background:#fff3cd;
}

.flash-study-area {
  display:grid;
  grid-template-columns:58px minmax(0,820px) 58px;
  align-items:center;
  justify-content:center;
  gap:1rem;
  margin-top:1rem;
}

.flash-nav-btn {
  width:52px;
  height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #d8e4ed;
  border-radius:50%;
  background:#fff;
  color:#35526a;
  font-size:1.35rem;
  box-shadow:0 6px 18px rgba(16,42,67,.06);
}

.flash-nav-btn:hover {
  color:#0d6efd;
  border-color:#9ec5fe;
  background:#f6faff;
}

.flash-card-scene {
  width:100%;
  min-height:430px;
  perspective:1600px;
}

.flash-card-3d {
  position:relative;
  width:100%;
  min-height:430px;
  transform-style:preserve-3d;
  transition:transform .5s cubic-bezier(.2,.72,.2,1);
  cursor:pointer;
  outline:none;
}

.flash-card-3d.is-flipped {
  transform:rotateY(180deg);
}

.flash-card-3d:focus-visible {
  border-radius:1.25rem;
  box-shadow:0 0 0 .25rem rgba(13,110,253,.18);
}

.flash-card-face {
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:3rem 3.2rem;
  border:1px solid #d7e3ec;
  border-radius:1.35rem;
  background:
    radial-gradient(circle at 10% 0%, rgba(32,201,151,.08), transparent 32%),
    #fff;
  box-shadow:0 18px 48px rgba(16,42,67,.11);
  backface-visibility:hidden;
  overflow:hidden;
}

.flash-card-back {
  transform:rotateY(180deg);
  background:
    radial-gradient(circle at 90% 0%, rgba(25,135,84,.09), transparent 34%),
    #fff;
}

.flash-side-label {
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  margin-bottom:1rem;
  padding:.38rem .7rem;
  border-radius:999px;
  background:#eaf3ff;
  color:#0d6efd;
  font-size:.72rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.055em;
}

.flash-side-label.is-answer {
  color:#146c43;
  background:#edf9f2;
}

.flash-main-text {
  max-width:720px;
  color:#102a43;
  font-size:clamp(1.7rem,4vw,2.8rem);
  line-height:1.24;
  font-weight:850;
  overflow-wrap:anywhere;
}

.flash-card-back .flash-main-text {
  font-size:clamp(1.45rem,3.2vw,2.25rem);
  font-weight:750;
}

.flash-turn-hint {
  position:absolute;
  bottom:1.1rem;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:.35rem;
  color:#7a8d9b;
  font-size:.74rem;
  white-space:nowrap;
}

.flash-answer-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,260px));
  justify-content:center;
  gap:.75rem;
  margin-top:1.1rem;
}

.flash-answer-actions .btn {
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.7rem;
  border-radius:1rem;
  text-align:left;
}

.flash-answer-actions .btn > i {
  font-size:1.35rem;
}

.flash-answer-actions strong,
.flash-answer-actions small {
  display:block;
}

.flash-answer-actions small {
  margin-top:.08rem;
  font-size:.7rem;
  font-weight:500;
  opacity:.76;
}

.flash-again-btn {
  color:#b42334;
  border:1px solid #efb4bb;
  background:#fff7f8;
}

.flash-again-btn:hover,
.flash-again-btn.is-selected {
  color:#fff;
  background:#dc3545;
  border-color:#dc3545;
}

.flash-know-btn {
  color:#146c43;
  border:1px solid #a9ddbf;
  background:#f2fbf6;
}

.flash-know-btn:hover,
.flash-know-btn.is-selected {
  color:#fff;
  background:#198754;
  border-color:#198754;
}

.flash-keyboard-hint {
  display:flex;
  justify-content:center;
  gap:1rem;
  margin-top:1rem;
  color:#7b8d9a;
  font-size:.7rem;
}

.flash-keyboard-hint kbd {
  background:#edf2f6;
  color:#526878;
  border:1px solid #d8e2e9;
  box-shadow:none;
  font-size:.65rem;
}

.flash-empty-study {
  min-height:420px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:2rem;
  border:1px dashed #c9d9e5;
  border-radius:1.2rem;
  background:#fafcfd;
}

.flash-empty-icon {
  width:70px;
  height:70px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:1rem;
  border-radius:1.1rem;
  color:#0d6efd;
  background:#eaf3ff;
  font-size:1.8rem;
}

.flash-input {
  min-height:110px;
  resize:vertical;
}

.flash-manage-list {
  display:flex;
  flex-direction:column;
  gap:.55rem;
}

.flash-manage-item {
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  align-items:center;
  gap:.75rem;
  padding:.75rem;
  border:1px solid #dde6ed;
  border-radius:.9rem;
  background:#fff;
}

.flash-manage-number {
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:.65rem;
  background:#edf4fa;
  color:#527087;
  font-size:.72rem;
  font-weight:900;
}

.flash-manage-question {
  min-width:0;
}

.flash-manage-question > strong {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.flash-manage-actions {
  display:flex;
  gap:.3rem;
}

.flash-status {
  display:inline-flex;
  align-items:center;
  gap:.2rem;
  margin-top:.3rem;
  padding:.2rem .42rem;
  border-radius:999px;
  color:#718594;
  background:#f1f4f6;
  font-size:.62rem;
  font-weight:800;
}

.flash-status.is-known {
  color:#146c43;
  background:#eaf7f0;
}

.flash-status.is-again {
  color:#a61d2d;
  background:#fff0f2;
}

.flash-manage-empty {
  min-height:280px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#6e8292;
}

.flash-manage-empty i {
  margin-bottom:.6rem;
  color:#93a8b8;
  font-size:2rem;
}

.flash-manage-empty strong,
.flash-manage-empty span {
  display:block;
}

.flash-manage-empty span {
  margin-top:.2rem;
  font-size:.78rem;
}

@media (max-width:767.98px) {
  .flashcards-hero {
    padding-bottom:1.5rem;
  }

  .flash-study-tabs {
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }

  .flash-study-tab {
    justify-content:center;
    padding:.62rem .5rem;
    font-size:.78rem;
  }

  .flash-study-topbar {
    display:block;
  }

  .flash-study-actions-top {
    margin-top:.7rem;
    justify-content:flex-start;
  }

  .flash-study-area {
    grid-template-columns:1fr;
    display:block;
  }

  .flash-nav-btn {
    display:none;
  }

  .flash-card-scene,
  .flash-card-3d {
    min-height:360px;
  }

  .flash-card-face {
    padding:2rem 1.15rem 3.2rem;
    border-radius:1rem;
  }

  .flash-main-text {
    font-size:clamp(1.45rem,7vw,2rem);
  }

  .flash-card-back .flash-main-text {
    font-size:clamp(1.25rem,6vw,1.75rem);
  }

  .flash-answer-actions {
    grid-template-columns:1fr 1fr;
    gap:.5rem;
  }

  .flash-answer-actions .btn {
    min-height:58px;
    gap:.4rem;
    padding:.5rem;
  }

  .flash-answer-actions small {
    display:none;
  }

  .flash-keyboard-hint {
    display:none;
  }

  .flash-manage-item {
    grid-template-columns:34px minmax(0,1fr);
  }

  .flash-manage-actions {
    grid-column:2;
    justify-content:flex-end;
  }

  .flash-manage-question > strong {
    white-space:normal;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }
}
