/*
 * v2/css/components.css — UI primitives (requires base.css first).
 *
 * Legacy class mapping (when HTML migrates):
 *   .btn-primary      → .btn.btn--primary
 *   .btn-secondary    → .btn.btn--secondary
 *   .btn-nav          → .btn.btn--nav
 *   .btn-danger       → .btn.btn--danger
 *   .btn-text-muted   → .btn.btn--ghost
 *   .nav-container    → .nav__inner
 *   .nav-links        → .nav__links
 *   .hamburger        → .nav__toggle
 *   .featured-card    → .card.card--featured
 *
 * No literal colours in this file — use var() / color-mix() with tokens from base.css only.
 */

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
    line-height: var(--leading-tight);
    text-align: center;
    cursor: pointer;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.btn--primary {
    background: var(--accent-primary);
    color: var(--bg-base);
    border-color: var(--accent-primary);
    font-weight: 700;
}

.btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn--secondary {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn--secondary:hover {
    background: var(--accent-primary);
    color: var(--bg-base);
}

.btn--nav {
    padding: var(--space-2) var(--space-5);
    background: var(--bg-surface-light);
    color: var(--text-main);
    border-color: transparent;
}

.nav__links .btn--nav:hover {
    background: var(--accent-primary);
    color: var(--bg-base);
}

/* Hero / high-emphasis CTA — sliding gradient on hover; uses --cta-text */
.btn--cta {
    background-color: var(--accent-blue);
    background-image: var(--cta-gradient);
    background-size: 200% auto;
    background-position: left center;
    color: var(--cta-text);
    border-color: transparent;
    font-weight: 500;
    transition:
        background-position var(--cta-gradient-transition),
        box-shadow 0.3s ease,
        color 0.3s ease;
    box-shadow:
        0 4px 16px color-mix(in srgb, var(--accent-blue) 45%, transparent),
        0 0 28px color-mix(in srgb, var(--accent-blue) 28%, transparent);
}

.btn--cta:hover {
    background-position: right center;
    color: var(--cta-text);
    border-color: transparent;
    box-shadow:
        0 6px 22px color-mix(in srgb, var(--accent-blue) 55%, transparent),
        0 0 36px color-mix(in srgb, var(--accent-blue) 38%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .btn--cta,
    .btn--cta:hover {
        background-position: left center;
        transition: box-shadow 0.3s ease, color 0.3s ease;
    }
}

.btn--danger {
    background: var(--error);
    color: var(--text-on-accent);
    border-color: var(--error);
    font-weight: 700;
}

.btn--danger:hover {
    background: color-mix(in srgb, var(--error) 88%, var(--text-main));
    border-color: color-mix(in srgb, var(--error) 88%, var(--text-main));
}

.btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
    font-size: var(--text-sm);
}

.btn--ghost:hover {
    color: var(--error);
    text-decoration: underline;
    transform: none;
}

.btn--small {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

.btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
}

/* Legacy alias — icon + label on one row (student resources, admin Add Student, etc.) */
.btn-icon {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.btn--block {
    display: block;
    width: 100%;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    margin: 0 0 var(--space-4);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    background: var(--bg-surface);
}

.alert--info {
    border-color: var(--info);
    color: var(--info);
    background: color-mix(in srgb, var(--info) 12%, var(--bg-surface));
}

.alert--success {
    border-color: var(--success);
    color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, var(--bg-surface));
}

.alert--warning {
    border-color: var(--warning);
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 12%, var(--bg-surface));
}

.alert--danger {
    border-color: var(--error);
    color: var(--error);
    background: color-mix(in srgb, var(--error) 12%, var(--bg-surface));
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-group label,
label.form-label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-muted);
    font-size: var(--text-base);
}

.form-control,
input.form-control,
select.form-control,
textarea.form-control,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-4);
    background: var(--bg-base);
    border: 1px solid var(--bg-surface-light);
    color: var(--text-main);
    font-family: var(--font-body);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-control::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-control:disabled,
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.info-block {
    margin-bottom: var(--space-5);
    color: var(--text-muted);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

.error-text {
    color: var(--error);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    position: relative;
    padding: var(--space-7) var(--space-6);
    background: var(--bg-base);
    border: 1px solid var(--bg-surface-light);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.card--interactive {
    transition:
        transform 0.25s cubic-bezier(0.2, 0, 0, 1),
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.card--interactive:hover {
    transform: translateY(-8px) translateZ(0);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-card-hover);
    z-index: 1;
}

.card--featured {
    overflow: hidden;
    border-color: var(--featured-border);
    background: linear-gradient(
        145deg,
        var(--featured-gradient-start) 0%,
        var(--featured-gradient-middle) 50%,
        var(--featured-gradient-end) 100%
    );
}

.card--featured .card__desc {
    color: var(--featured-card-desc);
}

.card--featured .card__price {
    color: var(--featured-card-price);
}

.card__title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.card__price {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--accent-primary);
    margin-bottom: var(--space-4);
}

.card__price-note {
    font-family: var(--font-body);
    font-size: var(--text-md);
    color: var(--text-muted);
}

.card__desc {
    margin-bottom: var(--space-6);
    color: var(--text-muted);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
}

.card__badge {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
    white-space: nowrap;
    background: var(--accent-primary);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-sm);
}

/* Corner ribbon — Giraudel transform; card overflow:hidden clips outer corners */
.card__badge--corner {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: var(--space-1) clamp(var(--space-4), 4vw, var(--space-6));
    text-align: center;
    pointer-events: none;
    transform:
        translateY(-100%)
        rotate(90deg)
        translateX(70.71067811865476%)
        rotate(-45deg);
    transform-origin: 100% 100%;
}

/* ==========================================================================
   Nav shell (positioning modifiers live in layout.css)
   ========================================================================== */

.nav {
    width: 100%;
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-container-x);
}

.nav__brand {
    display: flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 0;
}

/* JS / branding hook — do not rename */
.nav__brand .logo {
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: 0.125rem;
}

/* JS / branding hooks — do not rename */
.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.nav-logo-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: var(--nav-logo-height-expanded);
    max-height: 100%;
    object-fit: contain;
    transition: height 0.3s ease;
    filter: brightness(0) invert(1);
}

#navbar.scrolled .nav-logo-img {
    height: var(--nav-logo-height-compact);
}

.nav__links {
    display: none;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
}

.nav__links a {
    font-size: var(--text-base);
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
    color: var(--text-main);
}

.nav__links a:hover {
    color: var(--accent-primary);
}

.nav__links .btn--nav {
    flex-shrink: 0;
}

.nav__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3125rem;
    padding: var(--space-2);
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav__toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.nav-drawer-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    min-width: 2.5rem;
    min-height: 2.5rem;
    line-height: 1;
    background: transparent;
}

.nav-drawer-toggle__bars {
    display: block;
    width: 1.5rem;
    height: 2px;
    background: var(--text-main);
    position: relative;
    border-radius: 1px;
}

.nav-drawer-toggle__bars::before,
.nav-drawer-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-main);
    border-radius: 1px;
}

.nav-drawer-toggle__bars::before {
    top: -0.45rem;
}

.nav-drawer-toggle__bars::after {
    top: 0.45rem;
}

/* ==========================================================================
   Drawer (mobile navigation)
   ========================================================================== */

.drawer-overlay[hidden],
.drawer[hidden] {
    display: none !important;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 6000;
}

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(18.5rem, 88vw);
    background: var(--bg-base);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 6100;
    display: flex;
    flex-direction: column;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    padding: var(--space-4);
    box-sizing: border-box;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

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

.drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer__title {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.drawer__close {
    flex-shrink: 0;
}

.drawer__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.drawer__sectionTitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.drawer__item {
    width: 100%;
    text-align: left;
    padding: var(--space-3);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font: inherit;
    cursor: pointer;
}

.drawer__item:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

.drawer__item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.drawer__item--danger {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

.drawer__item--danger:hover {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.12);
}

.nav__toggle-bar,
.hamburger span,
.nav__toggle > span {
    display: block;
    width: 1.5625rem;
    height: 2px;
    background: var(--text-main);
    transition: var(--transition);
}

/* JS hook — main.js animates .hamburger span */

/* Mobile-first: expose inline links from desktop (1024px) up */
@media (min-width: 1024px) {
    .nav__links {
        display: flex;
    }

    .nav__toggle {
        display: none;
    }
}

/* Open state for mobile overlay (JS toggles .nav--open on .nav) */
.nav--open .nav__links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
}

@media (min-width: 1024px) {
    .nav--open .nav__links {
        flex-direction: row;
        align-items: center;
    }
}

/* ==========================================================================
   Boot loader — full-viewport auth-bootstrap overlay.
   Used by the student area; designed to be reused by the admin rebuild.
   Page-specific glue (z-index, :has() auto-hide triggers, fallback) lives in
   the relevant pages/*.css file, since it references page-specific IDs.
   ========================================================================== */

.boot-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    background: var(--bg-base);
    color: var(--text-main);
}

.boot-loader__spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid color-mix(in srgb, var(--text-main) 12%, transparent);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: bootLoaderSpin 0.9s linear infinite;
}

.boot-loader__text {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

@keyframes bootLoaderSpin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .boot-loader__spinner { animation: none; }
}

/* List panel loading row (student library / resources tabs) */

.dash-list-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-8) var(--space-4);
    list-style: none;
    color: var(--text-muted);
}

.dash-list-loader__spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid color-mix(in srgb, var(--text-main) 12%, transparent);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: bootLoaderSpin 0.9s linear infinite;
}

.dash-list-loader__text {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .dash-list-loader__spinner { animation: none; }
}

/* ==========================================================================
   Dashboard shell — shared student/admin layout primitives
   ========================================================================== */

.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .dashboard {
        flex-direction: row;
    }
}

.dashboard__main {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.sidebar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--card-border);
    width: 100%;
}

@media (min-width: 768px) {
    .sidebar {
        flex-direction: column;
        flex-wrap: nowrap;
        width: 4.5rem;
        min-height: calc(100vh - var(--nav-logo-height-compact));
        padding: var(--space-4) var(--space-2);
        border-bottom: none;
        border-right: 1px solid var(--card-border);
    }
}

@media (min-width: 1024px) {
    .sidebar {
        width: 5.5rem;
    }
}

.sidebar__group {
    display: contents;
}

@media (min-width: 768px) {
    .sidebar__group {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        width: 100%;
    }
}

.sidebar__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: var(--space-2);
    border: none;
    border-radius: var(--border-radius-md);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar__btn:hover,
.sidebar__btn:focus-visible {
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
    color: var(--text-main);
}

.sidebar__btn.is-active {
    background: var(--state-active-bg);
    color: var(--state-active-text);
}

.sidebar__avatar {
    margin-top: auto;
}

.tab-panel[hidden] {
    display: none !important;
}

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-4);
    width: 100%;
    max-width: 100%;
}

.panel__header {
    margin-bottom: var(--space-4);
}

.panel__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--text-main);
}

.panel__body {
    min-width: 0;
}

.list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-bottom: 1px solid var(--card-border);
    width: 100%;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: var(--text-base);
    color: var(--text-main);
}

.list-row__meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.list-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.dialog {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 0;
    max-width: min(28rem, calc(100vw - var(--space-8)));
    width: 100%;
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: var(--shadow-md);
}

.dialog::backdrop {
    background: color-mix(in srgb, var(--text-main) 40%, transparent);
}

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

.dialog__panel {
    padding: var(--space-5);
}

.dialog__title {
    margin: 0 0 var(--space-3);
    font-family: var(--font-heading);
    font-size: var(--text-lg);
}

.dialog__body {
    margin-bottom: var(--space-4);
}

.dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: flex-end;
}

.toast-container {
    position: fixed;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: min(24rem, calc(100vw - var(--space-8)));
    pointer-events: none;
}

.toast {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--border-radius-md);
    font-size: var(--text-sm);
    pointer-events: auto;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.toast--success {
    background: var(--success);
    color: var(--text-on-accent);
}

.toast--error {
    background: var(--error);
    color: var(--text-on-accent);
}

.toast--info {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-primary);
    color: var(--text-on-accent);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.avatar--sm {
    width: 2rem;
    height: 2rem;
    font-size: var(--text-sm);
}

.avatar--md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: var(--text-base);
}

.avatar--initials {
    letter-spacing: 0.02em;
}

.upload-progress {
    width: 100%;
    height: 0.5rem;
    background: color-mix(in srgb, var(--text-main) 10%, transparent);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.upload-progress__bar {
    height: 100%;
    background: var(--accent-primary);
    transition: width var(--transition-fast);
}

.empty-state {
    padding: var(--space-6);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.skeleton {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--text-main) 8%, transparent) 25%,
        color-mix(in srgb, var(--text-main) 14%, transparent) 50%,
        color-mix(in srgb, var(--text-main) 8%, transparent) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.2s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
    min-height: 1rem;
}

@keyframes skeletonShimmer {
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
}

/* ==========================================================================
   Library row bookmark (student + admin song/resource lists)
   ========================================================================== */

.gp-library-ui-bookmark {
    --icon-size: 24px;
    --icon-secondary-color: rgba(255, 255, 255, 0.55);
    --icon-hover-color: var(--accent-primary);
    --icon-primary-color: var(--accent-primary);
    --icon-circle-border: 1px solid var(--icon-primary-color);
    --icon-circle-size: 35px;
    --icon-anmt-duration: 0.3s;

    position: relative;
    flex-shrink: 0;
    min-width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gp-library-ui-bookmark input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gp-library-ui-bookmark .gp-library-bookmark-pictogram {
    width: var(--icon-size);
    height: var(--icon-size);
    color: var(--icon-secondary-color);
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform-origin: center;
    overflow: hidden;
}

.gp-library-ui-bookmark .gp-library-bookmark-pictogram svg {
    width: var(--icon-size);
    height: auto;
    display: block;
    fill: currentColor;
}

.gp-library-ui-bookmark .gp-library-bookmark-pictogram svg path {
    fill: currentColor;
}

.gp-library-ui-bookmark .gp-library-bookmark-pictogram::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid var(--icon-primary-color);
    opacity: 0;
    transform: scale(0);
}

.gp-library-ui-bookmark .gp-library-bookmark-pictogram::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--icon-circle-size);
    height: var(--icon-circle-size);
    margin: calc(var(--icon-circle-size) / -2) 0 0 calc(var(--icon-circle-size) / -2);
    box-sizing: border-box;
    border-radius: 50%;
    border: var(--icon-circle-border);
    opacity: 0;
    pointer-events: none;
}

.gp-library-ui-bookmark:hover .gp-library-bookmark-pictogram {
    color: var(--icon-hover-color);
}

.gp-library-ui-bookmark input:checked + .gp-library-bookmark-pictogram {
    color: var(--icon-primary-color);
}

.gp-library-ui-bookmark.is-animating input:checked + .gp-library-bookmark-pictogram::after {
    animation: gp-library-bookmark-circles var(--icon-anmt-duration) cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: var(--icon-anmt-duration);
}

.gp-library-ui-bookmark.is-animating input:checked + .gp-library-bookmark-pictogram {
    animation: gp-library-bookmark-bounce var(--icon-anmt-duration) forwards;
}

.gp-library-ui-bookmark.is-animating input:checked + .gp-library-bookmark-pictogram::before {
    animation: gp-library-bookmark-circle var(--icon-anmt-duration) cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: var(--icon-anmt-duration);
}

.gp-library-ui-bookmark input:disabled + .gp-library-bookmark-pictogram {
    cursor: progress;
    opacity: 0.55;
}

@keyframes gp-library-bookmark-bounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.25);
    }
    60% {
        transform: scale(0.92);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes gp-library-bookmark-circle {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1.6);
    }
}

@keyframes gp-library-bookmark-circles {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    100% {
        opacity: 0;
        transform: scale(2.5);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gp-library-ui-bookmark.is-animating input:checked + .gp-library-bookmark-pictogram,
    .gp-library-ui-bookmark.is-animating input:checked + .gp-library-bookmark-pictogram::before,
    .gp-library-ui-bookmark.is-animating input:checked + .gp-library-bookmark-pictogram::after {
        animation: none;
    }
}

/* Auth screens — [hidden] visibility (no JS style.display) */
[data-auth-screen][hidden] {
    display: none !important;
}

[data-auth-screen]:not([hidden]) {
    display: flex;
}

