/* ===========================================================================
   components.css — Reset, base e componentes (rd-*) do Vargas.Cursos
   =========================================================================== */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; }

::selection { background: var(--accent-tint); }

/* Tipografia utilitária ---------------------------------------------------- */
.rd-serif  { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; }
.rd-mono   { font-family: var(--font-mono); font-feature-settings: "ss01"; }

.rd-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.rd-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 550;
}
.rd-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Cards ------------------------------------------------------------------- */
.rd-card {
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--r-lg);
}

/* Botões ------------------------------------------------------------------ */
.rd-btn {
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .08s;
}
.rd-btn:active { transform: translateY(1px); }
.rd-btn:disabled { opacity: .55; cursor: not-allowed; }

.rd-btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.rd-btn--primary:hover:not(:disabled) { background: color-mix(in oklab, var(--accent) 88%, black); }

.rd-btn--ghost { border-color: var(--border-strong); color: var(--text); }
.rd-btn--ghost:hover:not(:disabled) { background: var(--hover); }

.rd-btn--soft { background: var(--accent-soft); color: var(--accent); }
.rd-btn--soft:hover:not(:disabled) { background: color-mix(in oklab, var(--accent-soft) 80%, var(--accent) 8%); }

.rd-btn--block { width: 100%; }
.rd-btn--sm { padding: 6px 12px; font-size: 13px; }

/* Pílulas / badges -------------------------------------------------------- */
.rd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0.01em;
}
.rd-pill--muted   { background: var(--surface-2); color: var(--muted); }
.rd-pill--success { background: var(--success-bg); color: var(--success); }
.rd-pill--warning { background: var(--warning-bg); color: var(--warning); }
.rd-pill--amazon  { background: var(--warning-bg); color: oklch(0.58 0.16 60); }

/* Inputs ------------------------------------------------------------------ */
.rd-input {
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--text);
  width: 100%;
}
.rd-input:focus { outline: 3px solid var(--accent-tint); border-color: var(--accent); }
.rd-input::placeholder { color: var(--muted-2); }

.rd-field { display: flex; flex-direction: column; gap: 6px; }
.rd-field > span { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.rd-field .rd-input-icon { position: relative; }
.rd-field .rd-input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.rd-field .rd-input-icon .rd-input { padding-left: 36px; }

/* Barra de progresso ------------------------------------------------------ */
.rd-progressbar {
  position: relative;
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.rd-progressbar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: var(--r-pill);
  transition: width .4s ease;
}

.rd-divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* Placeholder de imagem listrado ----------------------------------------- */
.rd-imgph {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--accent) 10%, var(--surface-2)) 0 14px,
      var(--surface-2) 14px 28px);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: var(--r-md);
  text-align: center;
  padding: 12px;
}

/* Avatar ------------------------------------------------------------------ */
.rd-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  font-size: 14px;
  overflow: hidden;
}

/* Mensagem / alerta ------------------------------------------------------- */
.rd-alert {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
}
.rd-alert.show { display: flex; }
.rd-alert--error   { background: var(--error-bg);   color: var(--error); }
.rd-alert--success { background: var(--success-bg); color: var(--success); }
.rd-alert--info    { background: var(--accent-soft); color: var(--accent); }

/* Topbar global ----------------------------------------------------------- */
.rd-topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.rd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.rd-brand-logo {
  height: 30px;
  width: auto;
  display: block;
}
.rd-brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.rd-brand-name .dot { color: var(--accent); }

.rd-nav { display: flex; gap: 4px; }
.rd-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}
.rd-nav a:hover { background: var(--surface-2); color: var(--text); }
.rd-nav a.active { color: var(--text); font-weight: 600; background: var(--surface-2); }

.rd-spacer { margin-left: auto; }

.rd-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.rd-iconbtn:hover { background: var(--hover); color: var(--text); }

/* Capa de curso ----------------------------------------------------------- */
.rd-cover {
  color: #fff;
  border-radius: var(--r-md);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.rd-cover::after {
  content: "";
  position: absolute; right: -30px; top: -20px;
  width: 120px; height: 120px;
  background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,0.08) 4px 6px);
  border-radius: 50%;
  pointer-events: none;
}
.rd-cover-code {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.78;
  letter-spacing: 0.1em;
}
.rd-cover-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.rd-cover-sub {
  font-size: 10px;
  opacity: 0.78;
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* Dropdown simples (menu do avatar) -------------------------------------- */
.rd-menu-wrap { position: relative; }
.rd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  padding: 6px;
  display: none;
  z-index: 50;
}
.rd-menu.open { display: block; }
.rd-menu a, .rd-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.rd-menu a:hover, .rd-menu button:hover { background: var(--hover); }
.rd-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
.rd-menu .danger { color: var(--error); }

/* Estado vazio ------------------------------------------------------------ */
.rd-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.rd-empty svg { color: var(--border-strong); margin-bottom: 12px; }
.rd-empty h3 { font-family: var(--font-serif); font-size: 18px; margin: 0 0 6px; color: var(--text); }
.rd-empty p { margin: 0 0 16px; font-size: 14px; }

/* Responsivo -------------------------------------------------------------- */
@media (max-width: 820px) {
  .rd-topbar { padding: 12px 18px; gap: 12px; }
  .rd-nav { display: none; }
}
