/**
 * Roda — telemóvel em pé vs tablet/notebook deitado.
 * v5: eixo único no telemóvel (roda + dica + cartão) e barra do hint centrada.
 * vf-wheel-short-viewport-v5
 */

[data-vf-aluno-wheel-home],
[data-vf-prof-wheel-home],
[data-vf-fam-wheel-home],
[data-vf-lic-wheel-home],
[data-vf-mat-wheel-home] {
  --vf-wheel-head: 44px;
  --vf-wheel-dock-h: 128px;
}

/* ——— Telemóvel em pé: layout clássico, eixo único, FAB fora do nome ——— */
@media (orientation: portrait) and (max-width: 1100px) {
  [data-vf-aluno-wheel-home],
  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel,
  [data-vf-prof-wheel-home],
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel,
  [data-vf-fam-wheel-home],
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel,
  [data-vf-lic-wheel-home],
  [data-vf-lic-wheel-home] .vf-lic-hub-wheel,
  [data-vf-mat-wheel-home],
  [data-vf-mat-wheel-home] .vf-lic-hub-wheel {
    --vf-lic-wheel-size: min(
      86vw,
      calc(100dvh - var(--vf-nav-h, 84px) - var(--vf-wheel-dock-h) - var(--vf-wheel-head) - 20px),
      340px
    ) !important;
    --vf-wheel-footer-clearance: calc(
      var(--vf-nav-h, 84px) + var(--vf-wheel-dock-h) + env(safe-area-inset-bottom, 0px)
    ) !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-aluno-wheel-home] .vf-lic-wheel-fullscreen--stage-only,
  [data-vf-prof-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-prof-wheel-home] .vf-lic-wheel-fullscreen--stage-only,
  [data-vf-fam-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-fam-wheel-home] .vf-lic-wheel-fullscreen--stage-only {
    position: fixed !important;
    inset: 0 !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-inline: 0 !important;
    padding-bottom: var(--vf-wheel-footer-clearance) !important;
    box-sizing: border-box !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-wheel-fullscreen__stage,
  [data-vf-prof-wheel-home] .vf-lic-wheel-fullscreen__stage,
  [data-vf-fam-wheel-home] .vf-lic-wheel-fullscreen__stage {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 auto !important;
    padding: 8px 0 0 !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel--fullscreen,
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel--fullscreen,
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel--fullscreen {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    align-items: center !important;
    display: flex !important;
    flex-direction: column !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__head--fullscreen,
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__head--fullscreen,
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel__head--fullscreen {
    width: min(100%, var(--vf-lic-wheel-size)) !important;
    max-width: var(--vf-lic-wheel-size) !important;
    margin-inline: auto !important;
    text-align: center !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__ring--circular,
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__ring--circular,
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel__ring--circular {
    width: var(--vf-lic-wheel-size) !important;
    height: var(--vf-lic-wheel-size) !important;
    max-width: var(--vf-lic-wheel-size) !important;
    max-height: var(--vf-lic-wheel-size) !important;
    min-height: var(--vf-lic-wheel-size) !important;
    aspect-ratio: 1 / 1 !important;
    margin-inline: auto !important;
    flex-shrink: 0 !important;
  }

  [data-vf-aluno-wheel-home] .vf-aluno-wheel-footer-dock,
  [data-vf-aluno-wheel-home] .vf-wheel-footer-dock,
  [data-vf-prof-wheel-home] .vf-prof-wheel-footer-dock,
  [data-vf-prof-wheel-home] .vf-wheel-footer-dock,
  [data-vf-fam-wheel-home] .vf-fam-wheel-footer-dock,
  [data-vf-fam-wheel-home] .vf-wheel-footer-dock {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: calc(var(--vf-nav-h, 84px) + 10px + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    width: min(var(--vf-lic-wheel-size), calc(100vw - 32px)) !important;
    max-width: min(var(--vf-lic-wheel-size), calc(100vw - 32px)) !important;
    margin: 0 auto !important;
    z-index: 40 !important;
  }

  html.vf-mobile-app-only:has([data-vf-aluno-wheel-home]) .vf-ai-fab,
  html.vf-mobile-app-only:has([data-vf-prof-wheel-home]) .vf-ai-fab,
  html:has([data-vf-aluno-wheel-home]) .vf-ai-fab,
  html:has([data-vf-prof-wheel-home]) .vf-ai-fab {
    right: 12px !important;
    bottom: calc(
      var(--vf-nav-h, 84px) + var(--vf-wheel-dock-h) + 18px + env(safe-area-inset-bottom, 0px)
    ) !important;
  }

  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__picker-hint,
  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__picker-hint {
    display: block !important;
    width: min(100%, var(--vf-lic-wheel-size)) !important;
    max-width: var(--vf-lic-wheel-size) !important;
    margin: 8px auto 0 !important;
    padding: 0 12px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    position: relative !important;
  }

  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__picker-hint::after,
  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__picker-hint::after {
    content: "" !important;
    display: block !important;
    width: min(168px, 58%) !important;
    height: 2px !important;
    margin: 8px auto 0 !important;
    border-radius: 99px !important;
    background: rgba(212, 175, 55, 0.55) !important;
  }

  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__head-eyebrow-row,
  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__head-eyebrow-row {
    justify-content: center !important;
    width: 100% !important;
  }
}

/* ——— Tablet / notebook deitado: bloco único centrado ——— */
@media (orientation: landscape) and (max-height: 980px),
  (min-width: 768px) and (max-height: 820px) {
  [data-vf-aluno-wheel-home],
  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel,
  [data-vf-prof-wheel-home],
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel,
  [data-vf-fam-wheel-home],
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel,
  [data-vf-lic-wheel-home],
  [data-vf-lic-wheel-home] .vf-lic-hub-wheel,
  [data-vf-mat-wheel-home],
  [data-vf-mat-wheel-home] .vf-lic-hub-wheel {
    --vf-lic-wheel-size: min(
      52dvh,
      56vw,
      calc(100dvh - var(--vf-nav-h, 84px) - var(--vf-wheel-head) - var(--vf-wheel-dock-h) - 12px),
      312px
    ) !important;
  }

  [data-vf-aluno-wheel-home],
  [data-vf-prof-wheel-home],
  [data-vf-fam-wheel-home],
  [data-vf-lic-wheel-home],
  [data-vf-mat-wheel-home] {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
    min-height: 100dvh !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: calc(var(--vf-nav-h, 84px) + 10px + env(safe-area-inset-bottom, 0px)) !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-aluno-wheel-home] .vf-lic-wheel-fullscreen--stage-only,
  [data-vf-prof-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-prof-wheel-home] .vf-lic-wheel-fullscreen--stage-only,
  [data-vf-fam-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-fam-wheel-home] .vf-lic-wheel-fullscreen--stage-only,
  [data-vf-lic-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-lic-wheel-home] .vf-lic-wheel-fullscreen--stage-only,
  [data-vf-mat-wheel-home] .vf-lic-wheel-fullscreen,
  [data-vf-mat-wheel-home] .vf-lic-wheel-fullscreen--stage-only {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    min-height: 0 !important;
    width: auto !important;
    flex: 0 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel--fullscreen,
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel--fullscreen,
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel--fullscreen {
    width: var(--vf-lic-wheel-size) !important;
    margin-inline: auto !important;
    height: auto !important;
    flex: 0 0 auto !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-lic-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-mat-wheel-home] .vf-lic-hub-wheel__wrap,
  [data-vf-aluno-wheel-home] .vf-lic-hub-wheel__ring--circular,
  [data-vf-prof-wheel-home] .vf-lic-hub-wheel__ring--circular,
  [data-vf-fam-wheel-home] .vf-lic-hub-wheel__ring--circular,
  [data-vf-lic-wheel-home] .vf-lic-hub-wheel__ring--circular,
  [data-vf-mat-wheel-home] .vf-lic-hub-wheel__ring--circular {
    width: var(--vf-lic-wheel-size) !important;
    height: var(--vf-lic-wheel-size) !important;
    max-width: var(--vf-lic-wheel-size) !important;
    max-height: var(--vf-lic-wheel-size) !important;
    min-height: var(--vf-lic-wheel-size) !important;
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
  }

  [data-vf-aluno-wheel-home] .vf-lic-wheel-fullscreen__stage,
  [data-vf-prof-wheel-home] .vf-lic-wheel-fullscreen__stage,
  [data-vf-fam-wheel-home] .vf-lic-wheel-fullscreen__stage {
    height: auto !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center !important;
  }

  [data-vf-aluno-wheel-home] .vf-aluno-wheel-footer-dock,
  [data-vf-aluno-wheel-home] .vf-wheel-footer-dock,
  [data-vf-prof-wheel-home] .vf-prof-wheel-footer-dock,
  [data-vf-prof-wheel-home] .vf-wheel-footer-dock,
  [data-vf-fam-wheel-home] .vf-fam-wheel-footer-dock,
  [data-vf-fam-wheel-home] .vf-wheel-footer-dock,
  [data-vf-lic-wheel-home] .vf-lic-wheel-footer-dock,
  [data-vf-lic-wheel-home] .vf-wheel-footer-dock,
  [data-vf-mat-wheel-home] .vf-mat-wheel-footer-dock,
  [data-vf-mat-wheel-home] .vf-wheel-footer-dock {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 10px auto 0 !important;
    z-index: 20 !important;
    width: min(var(--vf-lic-wheel-size, 320px), calc(100vw - 24px)) !important;
    max-width: min(420px, calc(100vw - 24px)) !important;
  }

  html.vf-mobile-app-only:has([data-vf-prof-wheel-home]) .vf-ai-fab,
  html:has([data-vf-prof-wheel-home]) .vf-ai-fab,
  html.vf-mobile-app-only:has([data-vf-aluno-wheel-home]) .vf-ai-fab,
  html:has([data-vf-aluno-wheel-home]) .vf-ai-fab {
    bottom: calc(var(--vf-nav-h, 84px) + 12px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
