.aluno-page {
  min-height: 100vh;
  background: var(--bg);
}

/* Altura reservada ao chrome abaixo do player (título + toolbar + utils) */
.aluno-page {
  --curso-topbar-h: 56px;
  --lesson-chrome-h: 9.5rem;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

/* —— Top bar —— */
.curso-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
}

.curso-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.55rem clamp(0.9rem, 2.5vw, 1.5rem);
}

.curso-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

.curso-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.curso-brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 999px;
  box-shadow:
    0 0 0 2px rgba(212, 175, 55, 0.5),
    0 0 0 4px rgba(20, 184, 166, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.32);
}

.gate-card > img {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 999px;
  margin-bottom: 0.25rem;
  box-shadow:
    0 0 0 2.5px rgba(212, 175, 55, 0.5),
    0 0 0 7px rgba(20, 184, 166, 0.14),
    0 18px 40px rgba(0, 0, 0, 0.4);
}

.crumb-sep {
  color: var(--text-muted);
}

.crumb-track,
.crumb-current {
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18ch;
}

.crumb-current {
  color: var(--accent);
  font-weight: 700;
}

.curso-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.aluno-chip {
  display: none;
  flex-direction: column;
  line-height: 1.15;
  text-align: right;
}

.aluno-chip small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.enrolled-pill {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* —— Layout player + conteúdo —— */
.curso-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100dvh - var(--curso-topbar-h));
}

.curso-stage {
  padding: 0.85rem clamp(0.9rem, 2.5vw, 1.5rem) 1.25rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.curso-sidebar {
  border-top: 1px solid var(--border);
  background: var(--bg-solid);
  display: flex;
  flex-direction: column;
  max-height: none;
}

/* —— Video —— */
.video-frame {
  --player-ratio: 1.7778; /* 16:9 numérico — JS ajusta ao vídeo real */
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: var(--player-ratio);
  width: min(100%, calc(var(--player-max-h, 70dvh) * var(--player-ratio)));
  max-width: 100%;
  max-height: var(--player-max-h, calc(100dvh - var(--curso-topbar-h) - var(--lesson-chrome-h)));
  height: auto;
  margin-inline: auto;
  box-shadow: var(--card-shadow);
  flex: 0 1 auto;
  align-self: center;
}

.video-frame.is-fitted {
  width: var(--player-w);
  height: var(--player-h);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: unset;
  flex: 0 0 auto;
}

.video-frame.is-theater {
  position: fixed;
  inset: 0;
  z-index: 70;
  border-radius: 0;
  aspect-ratio: auto;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  margin: 0;
  --player-w: 100%;
  --player-h: 100%;
}

.video-frame video,
.video-frame .bunny-embed {
  width: 100%;
  height: 100%;
  display: block;
  background: #000 !important;
  border: 0;
  color-scheme: dark;
}

.video-frame video {
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 1;
}

.video-frame .bunny-embed {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* display:block acima não pode vencer o atributo hidden */
.video-frame video[hidden],
.video-frame .bunny-embed[hidden],
.video-fallback[hidden] {
  display: none !important;
}

.video-fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
}

.video-fallback img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35);
}

.fallback-copy {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  padding: 1.25rem;
  text-align: center;
  color: #f5faf8;
}

.fallback-copy h2 {
  color: #fff;
  margin: 0.5rem 0;
}

.fallback-copy p {
  color: rgba(245, 250, 248, 0.78);
  margin-bottom: 1rem;
}

.fallback-copy code {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

/* —— Lesson meta —— */
.lesson-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 0;
  flex: 0 0 auto;
}

.lesson-heading h1 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  margin: 0.1rem 0 0.45rem;
  line-height: 1.25;
}

.lesson-byline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.instructor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
}

.lesson-byline strong {
  display: block;
  font-size: 0.92rem;
}

.lesson-byline small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.lesson-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tool-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-solid);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: border-color var(--duration), background var(--duration), color var(--duration);
}

.tool-btn svg {
  width: 18px;
  height: 18px;
}

.tool-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tool-btn.is-done {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
}

.lesson-nav-btns {
  display: flex;
  gap: 0.35rem;
}

.lesson-utils {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
}

/* —— Curtidas e comentários —— */
.lesson-engagement {
  margin-top: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
}

.engagement-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-solid);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
}

.like-btn svg {
  width: 18px;
  height: 18px;
}

.like-btn.is-liked {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.like-btn.is-liked svg path {
  fill: currentColor;
}

.like-btn strong {
  font-size: 0.85rem;
}

.engagement-meta {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.comment-form {
  display: grid;
  gap: 0.5rem;
}

.comment-form label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-soft);
}

.comment-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.comment-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.comment-error {
  color: #f87171;
  font-size: 0.86rem;
  margin: 0;
}

.comments-list {
  display: grid;
  gap: 0.7rem;
}

.comment-card {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.comment-card header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
}

.comment-card strong {
  font-size: 0.9rem;
}

.comment-card time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.comment-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comments-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.4rem 0;
}

.comment-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
}

.comment-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.comment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.comment-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.comment-badge.is-question {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #fbbf24;
}

.comment-badge.is-answered {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--success);
}

.comment-badge.is-instructor {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.comment-replies {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: grid;
  gap: 0.55rem;
}

.reply-card {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-solid);
  border: 1px solid var(--border);
}

.reply-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.35rem;
}

.reply-card header time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reply-card p {
  margin: 0;
  line-height: 1.45;
  color: var(--text);
}

.reply-card.is-instructor {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-solid));
  box-shadow: inset 3px 0 0 var(--accent);
}

.reply-form {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.4rem;
}

.reply-form textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-solid);
  color: var(--text);
  font: inherit;
}

.reply-toggle {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.util-chip {
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-solid);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.util-chip:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

.util-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* —— Sidebar conteúdo —— */
.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.sidebar-tab {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  background: transparent;
}

.sidebar-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sidebar-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sidebar-course-head {
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-course-head h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0.15rem 0 0.85rem;
  line-height: 1.3;
}

.sidebar-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.sidebar-progress-meta strong {
  color: var(--accent);
}

.content-tree {
  padding: 0.65rem;
  display: grid;
  gap: 0.45rem;
  overflow: auto;
  align-content: start;
  align-items: stretch;
}

.avulsa-upsell {
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  display: grid;
  gap: 0.55rem;
}

.avulsa-upsell p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.module-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  align-self: start;
  width: 100%;
}

.module-block.is-open {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.module-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.55rem;
  align-items: center;
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: transparent;
}

.module-toggle:hover {
  background: var(--accent-soft);
}

.module-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
}

.module-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.module-toggle-copy strong {
  font-size: 0.86rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-toggle-copy small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.module-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.module-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 180ms ease;
  opacity: 0.75;
}

.module-block.is-open .module-chevron {
  transform: rotate(225deg);
}

.module-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  gap: 0.2rem;
}

.module-block.is-open .module-lessons {
  display: grid;
  padding: 0 0.4rem 0.45rem;
}

.lesson-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}

.lesson-row:hover {
  background: var(--accent-soft);
}

.lesson-row.is-current {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-soft);
}

.lesson-row.is-done .lesson-check {
  background: var(--success);
  color: #042f2e;
  border-color: transparent;
}

.lesson-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lesson-row-copy {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.lesson-row-copy strong {
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.3;
}

.lesson-row-copy small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.here-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  white-space: nowrap;
}

/* —— Mobile sidebar drawer —— */
.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.5);
}

.sidebar-scrim[hidden] {
  display: none;
}

@media (max-width: 1099px) {
  .curso-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: min(380px, 92vw);
    border-top: none;
    border-left: 1px solid var(--border);
    transform: translateX(105%);
    transition: transform 240ms var(--ease, ease);
    max-height: 100vh;
  }

  .curso-sidebar.is-open {
    transform: translateX(0);
  }

  .content-tree {
    flex: 1;
    max-height: calc(100vh - 180px);
  }
}

@media (min-width: 720px) {
  .aluno-chip {
    display: flex;
  }

  .crumb-track,
  .crumb-current {
    max-width: 28ch;
  }
}

@media (min-width: 1100px) {
  /* Tudo cabe na viewport: player encolhe; teatro/fullscreen ficam no player */
  .aluno-page {
    height: 100dvh;
    overflow: hidden;
  }

  .curso-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    height: calc(100dvh - var(--curso-topbar-h));
    min-height: 0;
    overflow: hidden;
  }

  .curso-stage {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0.75rem 1.1rem 0.85rem;
  }

  .video-frame {
    flex: 1 1 auto;
    min-height: 0;
    width: min(100%, calc(var(--player-max-h, 100%) * var(--player-ratio, 1.777)));
    max-width: 100%;
    max-height: 100%;
  }

  .video-frame.is-fitted {
    flex: 0 0 auto;
  }

  .lesson-engagement {
    flex: 0 1 220px;
    max-height: min(220px, 26vh);
    overflow: auto;
  }

  .curso-sidebar {
    border-top: none;
    border-left: 1px solid var(--border);
    position: sticky;
    top: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .content-tree {
    flex: 1;
    min-height: 0;
    overflow: auto;
  }

  .sidebar-toggle {
    display: none;
  }
}

/* —— Auth gate —— */
.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  overflow: auto;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(20, 184, 166, 0.22), transparent 55%),
    radial-gradient(900px 500px at 110% 20%, rgba(212, 175, 55, 0.16), transparent 50%),
    rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(14px);
}

.gate[hidden] {
  display: none !important;
}

.gate-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
  animation: gate-float 9s ease-in-out infinite;
}

.gate-orb-a {
  width: 220px;
  height: 220px;
  left: 12%;
  top: 18%;
  background: rgba(20, 184, 166, 0.35);
}

.gate-orb-b {
  width: 180px;
  height: 180px;
  right: 14%;
  bottom: 16%;
  background: rgba(212, 175, 55, 0.28);
  animation-delay: -3s;
}

@keyframes gate-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

.gate-card,
.silica-card {
  position: relative;
  width: min(420px, 100%);
  padding: 1.7rem 1.4rem;
  border-radius: 22px;
  text-align: center;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  color: #eef5ff;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(22px) saturate(1.25);
}

.gate-card[hidden],
.silica-card[hidden] {
  display: none !important;
}

.gate-card h2,
.silica-card h2 {
  margin: 0;
  color: #fff;
  letter-spacing: -0.02em;
}

.gate-card p,
.silica-card p {
  color: rgba(236, 244, 255, 0.72);
  margin: 0;
}

.login-form {
  width: 100%;
  display: grid;
  gap: 0.7rem;
  text-align: left;
}

.login-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(236, 244, 255, 0.7);
}

.login-form input {
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 14, 24, 0.45);
  color: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input:focus {
  border-color: rgba(94, 234, 212, 0.65);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.gate-error {
  color: #fda4af !important;
  font-size: 0.88rem;
}

.text-link,
.silica-resend {
  color: #5eead4;
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.silica-resend:disabled {
  opacity: 0.45;
  cursor: default;
}

.silica-otp-head {
  position: relative;
  width: 100%;
}

.silica-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(94, 234, 212, 0.85) !important;
  margin-bottom: 0.35rem !important;
}

.silica-check {
  position: absolute;
  right: 0;
  top: 0.2rem;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #14b8a6;
  color: #042f2e;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
  animation: silica-pop 0.35s ease;
}

.silica-otp-form {
  width: 100%;
  display: grid;
  gap: 1rem;
}

.silica-otp {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  width: 100%;
  position: relative;
}

.silica-otp::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
}

.silica-otp.is-scanning::before {
  opacity: 1;
  animation: silica-scan 0.55s ease;
}

.silica-otp-box {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  color: #fff;
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  backdrop-filter: blur(10px);
  transition:
    transform 0.35s ease,
    background 0.35s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.silica-otp-box:focus {
  border-color: rgba(94, 234, 212, 0.7);
  box-shadow:
    0 0 0 3px rgba(20, 184, 166, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.silica-otp.is-success .silica-otp-box {
  background: linear-gradient(160deg, #5eead4, #14b8a6);
  border-color: rgba(15, 118, 110, 0.4);
  color: #042f2e;
  transform: rotateX(180deg);
  animation: silica-flip 0.45s ease forwards;
}

.silica-otp.is-success .silica-otp-box:nth-child(2) {
  animation-delay: 0.08s;
}
.silica-otp.is-success .silica-otp-box:nth-child(3) {
  animation-delay: 0.16s;
}
.silica-otp.is-success .silica-otp-box:nth-child(4) {
  animation-delay: 0.24s;
}

.silica-otp.is-error {
  animation: silica-shake 0.42s ease;
}

.silica-otp.is-error .silica-otp-box {
  border-color: rgba(251, 113, 133, 0.8);
  background: rgba(127, 29, 29, 0.35);
  color: #fecdd3;
}

@keyframes silica-scan {
  from {
    transform: translateX(-40%);
  }
  to {
    transform: translateX(40%);
  }
}

@keyframes silica-flip {
  from {
    transform: rotateX(0deg);
  }
  to {
    transform: rotateX(360deg);
  }
}

@keyframes silica-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

@keyframes silica-pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
