/**
 * TidyHQ account page + profile menu (v2).
 * Profile menu is injected into the site nav (beside LEAP); the account content
 * renders via [tidyhq_account] below the theme's orange title band. All rules are
 * scoped to .tidyhq- elements — no global resets — so nothing leaks into the theme.
 * REA brand: teal #017A8F, orange #F66E22, amber #FBC02D.
 */
:root {
    --tidyhq-teal: #017A8F;
    --tidyhq-teal-deep: #015C6B;
    --tidyhq-teal-ink: #014653;
    --tidyhq-orange: #FF7A40;
    --tidyhq-orange-btn: #F66E22;
    --tidyhq-orange-hover: #D45A15;
    --tidyhq-orange-light: #FCE1D0;
    --tidyhq-amber: #FBC02D;
    --tidyhq-amber-hover: #EDB018;
    --tidyhq-cream: #FBF3E2;
    --tidyhq-ink: #333333;
    --tidyhq-muted: #5C554A;
    --tidyhq-white: #FFFFFF;
    --tidyhq-line: rgba(1, 122, 143, .16);
    --tidyhq-hair: rgba(1, 70, 83, .12);
    --tidyhq-card-shadow: 0 18px 44px -22px rgba(1, 70, 83, .32), 0 3px 10px -6px rgba(1, 70, 83, .12);
    --tidyhq-menu-shadow: 0 16px 40px -12px rgba(1, 70, 83, .32);
    --tidyhq-focus: #014653;
    --tidyhq-r-lg: 22px;
    --tidyhq-r-md: 16px;
    --tidyhq-r-sm: 12px;
    --tidyhq-font-display: "Lato", "Segoe UI", system-ui, -apple-system, sans-serif;
    --tidyhq-font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Scoped box-sizing + small resets (never global) */
.tidyhq-page, .tidyhq-page *, .tidyhq-page *::before, .tidyhq-page *::after,
.tidyhq-profile, .tidyhq-profile *, .tidyhq-profile *::before, .tidyhq-profile *::after {
    box-sizing: border-box;
}
.tidyhq-page svg, .tidyhq-profile svg { display: block; }
.tidyhq-page h1, .tidyhq-page h2, .tidyhq-page h3, .tidyhq-page p, .tidyhq-page ul { margin: 0; }

.tidyhq-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tidyhq-page :focus-visible,
.tidyhq-profile :focus-visible,
.tidyhq-menu :focus-visible {
    outline: 3px solid var(--tidyhq-focus); outline-offset: 2px; border-radius: 6px;
}
.tidyhq-profile__btn:focus-visible { outline-color: var(--tidyhq-teal-deep); }

/* ---------- Profile menu (injected beside LEAP; also usable inline/floating) ---------- */
.tidyhq-profile-menu-item { display: flex; align-items: center; list-style: none; margin: 0; padding: 0 0 0 14px; }
.tidyhq-profile-menu-item::before, .tidyhq-profile-menu-item::marker { content: none; }
.tidyhq-profile-float { position: fixed; top: 12px; right: 16px; z-index: 9990; }
.tidyhq-profile { position: relative; display: inline-block; font-family: var(--tidyhq-font-body); }
.tidyhq-profile__btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
    background: linear-gradient(150deg, var(--tidyhq-teal), var(--tidyhq-teal-deep));
    color: var(--tidyhq-white); font-family: var(--tidyhq-font-display); font-weight: 800; font-size: .92rem;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28), 0 4px 12px -6px rgba(1, 70, 83, .6);
    transition: transform .16s ease, box-shadow .16s ease;
}
.tidyhq-profile__btn:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .34), 0 8px 18px -8px rgba(1, 70, 83, .7); }

/* <summary> as the toggle — native <details> open/close, no JS required */
.tidyhq-profile > summary.tidyhq-profile__btn { list-style: none; }
.tidyhq-profile__btn::-webkit-details-marker { display: none; }
.tidyhq-profile__btn::marker { content: ""; }

/* Logged-out guest icon: light-orange fill, deep-orange person + ring, no glow */
.tidyhq-profile__btn--guest {
    background: var(--tidyhq-orange-light); color: var(--tidyhq-orange-btn);
    box-shadow: inset 0 0 0 2px var(--tidyhq-orange-hover); text-decoration: none;
}
.tidyhq-profile__btn--guest:hover { transform: none; background: #FBD3BC; box-shadow: inset 0 0 0 2px var(--tidyhq-orange-hover); }

/* Logged-out control: person icon with a "Login" label beneath */
.tidyhq-profile-login { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; }
.tidyhq-profile-login__text { font-family: var(--tidyhq-font-body); font-weight: 700; font-size: .68rem; letter-spacing: .03em; line-height: 1; color: var(--tidyhq-orange-hover); }
.tidyhq-profile-login:hover .tidyhq-profile__btn--guest { background: #FBD3BC; }
.tidyhq-profile-login:hover .tidyhq-profile-login__text { text-decoration: underline; }

/* ---------- Compact account control for the mini top bar ---------- */
/* The account control is injected at the right-hand end of the theme's thin top
   bar (~32px tall, teal 14px Lato links). These rules shrink it to sit on that
   single line so it no longer wraps the main nav row below. Scoped to the
   injected --mini list item, so the standalone [tidyhq_profile_menu] shortcode
   keeps its full-size avatar. */
.tidyhq-profile-menu-item--mini { padding: 0; }

/* Logged-out: a small person icon + "Login" inline, matching the bar's links. */
.tidyhq-profile-menu-item--mini .tidyhq-profile-login {
    flex-direction: row; gap: 6px; align-items: center; line-height: 1;
}
.tidyhq-profile-menu-item--mini .tidyhq-profile__btn--guest {
    width: auto; height: auto; padding: 0; border-radius: 0;
    background: none; box-shadow: none; color: var(--tidyhq-teal);
}
.tidyhq-profile-menu-item--mini .tidyhq-profile__btn--guest:hover {
    background: none; box-shadow: none; transform: none;
}
.tidyhq-profile-menu-item--mini .tidyhq-profile__btn--guest svg { width: 17px; height: 17px; }
.tidyhq-profile-menu-item--mini .tidyhq-profile-login__text {
    font-family: var(--tidyhq-font-display); font-weight: 500; font-size: 14px;
    letter-spacing: normal; color: var(--tidyhq-teal);
}
.tidyhq-profile-menu-item--mini .tidyhq-profile-login:hover .tidyhq-profile__btn--guest { background: none; }
.tidyhq-profile-menu-item--mini .tidyhq-profile-login:hover .tidyhq-profile-login__text {
    color: var(--tidyhq-teal-deep); text-decoration: underline;
}

/* Logged-in: a compact avatar that fits the 32px-tall bar. */
.tidyhq-profile-menu-item--mini .tidyhq-profile__btn {
    width: 26px; height: 26px; font-size: .72rem;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3), 0 2px 6px -3px rgba(1, 70, 83, .6);
}

.tidyhq-menu {
    display: none;
    position: absolute; top: calc(100% + 12px); right: 0; min-width: 242px;
    background: var(--tidyhq-white); border: 1px solid var(--tidyhq-line);
    border-radius: var(--tidyhq-r-md); box-shadow: var(--tidyhq-menu-shadow);
    padding: 8px; list-style: none; margin: 0; transform-origin: top right; z-index: 9995;
}
.tidyhq-profile[open] > .tidyhq-menu { display: block; animation: tidyhq-pop .16s ease-out both; }
@keyframes tidyhq-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.tidyhq-menu::before {
    content: ""; position: absolute; top: -7px; right: 15px; width: 12px; height: 12px;
    background: var(--tidyhq-white); border-left: 1px solid var(--tidyhq-line); border-top: 1px solid var(--tidyhq-line);
    transform: rotate(45deg);
}
.tidyhq-menu__head { padding: 8px 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--tidyhq-line); }
.tidyhq-menu__name { font-family: var(--tidyhq-font-display); font-weight: 800; font-size: .95rem; color: var(--tidyhq-teal-ink); }
.tidyhq-menu__meta { font-size: .78rem; color: var(--tidyhq-muted); }
.tidyhq-menu__item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    text-decoration: none; color: var(--tidyhq-ink); font-size: .94rem; font-weight: 600;
}
.tidyhq-menu__item .tidyhq-ico { color: var(--tidyhq-teal); flex: 0 0 auto; }
.tidyhq-menu__item:hover { background: rgba(1, 122, 143, .09); color: var(--tidyhq-teal-ink); }
.tidyhq-menu__item:focus-visible { background: rgba(1, 122, 143, .12); }
.tidyhq-menu__ext { margin-left: auto; color: var(--tidyhq-muted); }
.tidyhq-menu__sep { height: 1px; background: var(--tidyhq-line); margin: 6px 4px; }
.tidyhq-menu__item--danger { color: var(--tidyhq-orange-hover); }
.tidyhq-menu__item--danger .tidyhq-ico { color: var(--tidyhq-orange-hover); }
.tidyhq-menu__item--danger:hover { background: rgba(212, 90, 21, .1); color: var(--tidyhq-orange-hover); }

/* ---------- Account content (below the theme's orange band) ---------- */
.tidyhq-page { padding: 26px 0 60px; font-family: var(--tidyhq-font-body); color: var(--tidyhq-ink); }
.tidyhq-account-col { max-width: 680px; margin: 0 auto 0 0; display: flex; flex-direction: column; gap: 18px; }

.tidyhq-card {
    background: var(--tidyhq-white); border-radius: var(--tidyhq-r-lg);
    box-shadow: var(--tidyhq-card-shadow); padding: 26px;
    animation: tidyhq-rise .45s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes tidyhq-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tidyhq-card__head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tidyhq-avatar {
    flex: 0 0 auto; width: 72px; height: 72px; border-radius: 999px; display: grid; place-items: center;
    background: linear-gradient(150deg, var(--tidyhq-teal), var(--tidyhq-teal-deep));
    color: var(--tidyhq-white); font-family: var(--tidyhq-font-display); font-weight: 900; font-size: 1.55rem;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .25), 0 8px 18px -10px rgba(1, 70, 83, .6);
    position: relative;
}
.tidyhq-avatar::after {
    content: ""; position: absolute; inset: -4px; border-radius: 999px; z-index: -1;
    background: conic-gradient(from 210deg, var(--tidyhq-amber), var(--tidyhq-orange), var(--tidyhq-amber)); opacity: .9;
}
.tidyhq-headtext { min-width: 0; }
.tidyhq-welcome {
    font-family: var(--tidyhq-font-display); font-weight: 800;
    font-size: clamp(1.35rem, 4.2vw, 1.75rem); line-height: 1.12; color: var(--tidyhq-teal-ink); text-wrap: balance;
}
.tidyhq-welcome .tidyhq-name { color: var(--tidyhq-teal); }
.tidyhq-badge {
    display: inline-flex; align-items: center; gap: 9px; margin-top: 9px;
    background: rgba(1, 122, 143, .09); color: var(--tidyhq-teal-ink);
    padding: 5px 13px 5px 11px; border-radius: 999px; font-weight: 700; font-size: .8rem;
}
.tidyhq-badge__dot { width: 9px; height: 9px; border-radius: 999px; flex: 0 0 auto; background: var(--tidyhq-amber); box-shadow: 0 0 0 3px rgba(251, 192, 45, .28); }
.tidyhq-card__divider { height: 1px; background: var(--tidyhq-hair); margin: 22px 0; }

.tidyhq-secure { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; color: var(--tidyhq-muted); font-size: .92rem; }
.tidyhq-secure .tidyhq-ico { color: var(--tidyhq-teal); flex: 0 0 auto; margin-top: 2px; }
.tidyhq-secure strong { color: var(--tidyhq-teal-ink); font-weight: 700; }

.tidyhq-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.tidyhq-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-family: var(--tidyhq-font-body); font-weight: 700; font-size: 1rem;
    padding: 12px 20px; border-radius: 999px; border: 2px solid transparent;
    text-decoration: none; cursor: pointer; line-height: 1.1;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.tidyhq-btn:active { transform: translateY(1px); }
.tidyhq-btn--primary { background: var(--tidyhq-teal); color: var(--tidyhq-white); box-shadow: 0 12px 22px -13px rgba(1, 122, 143, .95); }
.tidyhq-btn--primary:hover { background: var(--tidyhq-teal-deep); box-shadow: 0 14px 26px -12px rgba(1, 70, 83, .95); }
.tidyhq-btn--ghost { background: var(--tidyhq-white); color: var(--tidyhq-teal-deep); border-color: var(--tidyhq-line); }
.tidyhq-btn--ghost:hover { border-color: var(--tidyhq-teal); background: rgba(1, 122, 143, .06); }
.tidyhq-btn--amber { background: var(--tidyhq-amber); color: var(--tidyhq-ink); box-shadow: 0 12px 22px -13px rgba(237, 176, 24, .95); }
.tidyhq-btn--amber:hover { background: var(--tidyhq-amber-hover); }
.tidyhq-btn .tidyhq-ico { flex: 0 0 auto; }

.tidyhq-resources {
    background: var(--tidyhq-white); border-radius: var(--tidyhq-r-lg); box-shadow: var(--tidyhq-card-shadow);
    padding: 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; position: relative; overflow: hidden;
    animation: tidyhq-rise .45s cubic-bezier(.2, .7, .3, 1) .06s both;
}
.tidyhq-resources::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(var(--tidyhq-teal), var(--tidyhq-amber)); }
.tidyhq-resources__icon { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: rgba(1, 122, 143, .1); color: var(--tidyhq-teal); }
.tidyhq-resources__body { flex: 1 1 220px; min-width: 0; }
.tidyhq-eyebrow { font-weight: 700; font-size: .67rem; letter-spacing: .18em; text-transform: uppercase; color: var(--tidyhq-teal); margin-bottom: 3px; }
.tidyhq-resources__title { font-family: var(--tidyhq-font-display); font-weight: 800; font-size: 1.18rem; color: var(--tidyhq-teal-ink); line-height: 1.15; }
.tidyhq-resources__desc { color: var(--tidyhq-muted); font-size: .9rem; margin-top: 3px; }
.tidyhq-resources .tidyhq-btn { flex: 0 0 auto; }

.tidyhq-foot { display: flex; align-items: center; gap: 7px; color: var(--tidyhq-muted); font-size: .8rem; margin-top: 2px; }
.tidyhq-foot .tidyhq-ico { color: var(--tidyhq-teal); }

@media (max-width: 520px) {
    .tidyhq-card, .tidyhq-resources { padding: 20px; }
    .tidyhq-actions .tidyhq-btn { width: 100%; }
    .tidyhq-resources .tidyhq-btn { width: 100%; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .tidyhq-page *, .tidyhq-profile *, .tidyhq-menu * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
