/* components.css
   Split from the original monolithic styles.css.
   Rules kept in original source order to preserve the cascade.
   189 rules. */

.cta-button {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: linear-gradient(45deg, var(--gold), var(--gold-bright));
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(240, 172, 63, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
    );
    transition: 0.5s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 172, 63, 0.4);
}

.cta-button:hover::before {
    left: 100%;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--text-hi);
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-hi);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
}

.form-group label {
    font-weight: 500;
    color: var(--text-hi);
    font-size: 1rem;
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-mid);
    margin-top: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(240, 172, 63, 0.2);
}

.alert.success {
    background-color: var(--ok-dim);
    color: var(--ok);
    border: 1px solid rgba(62, 207, 142, 0.35);
}

.alert.error {
    background-color: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(242, 109, 109, 0.35);
}

@media (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem;
    }

    .section-title h1 {
        font-size: 2rem;
    }

}

.recaptcha-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.g-recaptcha {
    transform-origin: left top;
}

@media screen and (max-width: 400px) {
    .g-recaptcha {
        transform: scale(0.85);
    }

}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--ink-800);
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 16px;
    position: relative;
    animation: slideInUp 0.4s ease;
    box-shadow: 0 15px 50px rgba(0,0,0,0.25);
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.close-btn {
    position: absolute;
    top: 18px;
    right: 22px;
    color: var(--text-mid);
    font-size: 2rem;
    line-height: 1;
    font-weight: bold;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 10;
}

.close-btn:hover {
    color: var(--text-hi);
    transform: scale(1.1);
}

.agreement-text {
    height: 60vh;
    overflow-y: auto;
    margin-top: 20px;
    padding-top: 10px;
    padding-right: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.preview-agreement-link {
    color: var(--gold);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.preview-agreement-link:hover {
    text-decoration: none;
}

.license-tab {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-mid);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.license-tab:hover {
    background-color: var(--line);
}

.license-panel {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.select-license-btn,
.get-license-btn,
.choose-membership-btn,
#confirm-acquire-license-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--gold);
    color: var(--text-hi);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.select-license-btn:hover,
.get-license-btn:hover,
.choose-membership-btn:hover,
#confirm-acquire-license-btn:hover {
    background-color: var(--gold-bright);
    transform: translateY(-2px);
}

.select-license-btn[disabled],
.get-license-btn[disabled],
.choose-membership-btn[disabled] {
    background-color: var(--ink-600);
    cursor: default;
    transform: none;
}

.choose-membership-btn,
.license-option-price > .choose-membership-btn {
    background-color: var(--ink-700);
}

.choose-membership-btn:hover,
.license-option-price > .choose-membership-btn:hover {
    background-color: var(--ink-900);
}

.more-details-toggle {
    background: transparent;
    border: none;
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 1rem;
    cursor: pointer;
    color: var(--text-mid);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    width: 100%;
}

.more-details-toggle:hover {
    color: var(--gold);
}

.more-details-toggle i {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#license-modal-body .loader {
    border: 5px solid var(--ink-700);
    border-top: 5px solid var(--gold);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

#license-modal .modal-content {
    padding: 0;
}

.library-header {
    background: linear-gradient(135deg, var(--ink-900), var(--ink-700));
    padding: 4rem 0;
    color: var(--text-light);
    text-align: center;
}

.library-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .mobile-filter-panel .custom-filter-dropdown.show {
        transform: translateY(0);
    }

    .search-row {
        gap: 1rem;
    }

    .mobile-filter-backdrop.show {
        display: block;
        opacity: 1;
    }

}

.mood-filter-wrapper {
    display: flex;
    flex-direction: column;
}

.search-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.filters select {
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--ink-800);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    min-width: 140px;
}

.filters select:hover {
    border-color: var(--gold);
}

.filters select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(240, 172, 63, 0.2);
}

.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button i {
    font-size: 1.5rem;
    color: var(--text-hi);
    margin-left: 4px;
}

.track-image:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.play-button:hover {
    background: var(--ink-800);
    transform: translate(-50%, -50%) scale(1.05);
}

.placeholder-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ink-900), var(--ink-700));
    position: relative;
    overflow: hidden;
}

.placeholder-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
    45deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
    );
    animation: placeholderShine 3s infinite linear;
    pointer-events: none;
}

.placeholder-icon i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.track-card:hover .placeholder-icon i {
    transform: scale(1.1);
}

.track-genre {
    color: var(--text-mid);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.license-button {
    display: block;
    text-align: center;
    padding: 1rem;
    background: var(--ink-900);
    color: var(--text-hi);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.license-button:hover {
    background: var(--ink-700);
}

.controls-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.tracks-container.grid-view .waveform-container {
    margin: 1.25rem 0;
    padding: 0.75rem;
    background: var(--line);
    border-radius: 8px;
    border: 1px solid var(--line);
}

.tracks-container.grid-view .license-button {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--ink-900);
    color: var(--text-hi);
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border-radius: 0 0 12px 12px;
}

.tracks-container.grid-view .license-button:hover {
    background: var(--ink-700);
}

.tracks-container.list-view .license-button {
    width: auto;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
    background: var(--ink-900);
    color: var(--text-hi);
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.tracks-container.list-view .license-button:hover {
    background: var(--ink-700);
    transform: scale(1.03);
}

.tracks-container.list-view .placeholder-icon {
    border-radius: 8px;
}

.tracks-container.list-view .placeholder-icon i {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .controls-wrapper {
        flex-direction: column;
    }

    .waveform-container {
        display: none !important;
    }

    .tracks-container .license-button,
    .tracks-container .license-button.primary {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        margin: 0 !important;
        height: fit-content !important;
    }

    .play-button {
        width: 40px !important;
        height: 40px !important;
    }

    .play-button i {
        font-size: 1rem !important;
    }

}

.audio-player .placeholder-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ink-900), var(--ink-700));
    color: var(--text-hi);
    border-radius: 8px;
}

.audio-player .placeholder-icon i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.custom-filter-dropdown.show {
    display: flex;
}

.selected-mood-tag {
    display: flex;
    align-items: center;
    background: rgba(240, 172, 63, 0.1);
    color: var(--gold);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.selected-mood-tag span {
    margin-right: 0.5rem;
}

.remove-mood-tag {
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.remove-mood-tag:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .custom-filter-dropdown.show {
        display: flex;
        flex-direction: column;
    }

}

.moods-label {
    color: var(--text-hi);
    font-weight: 600;
    font-size: 0.9rem;
}

.mood-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(240, 172, 63, 0.1);
    color: var(--gold);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mood-tag:hover {
    background: rgba(240, 172, 63, 0.2);
}

@media (max-width: 768px) {
    .mood-tag {
        padding: 0.15rem 0.5rem;
        font-size: 0.8rem;
    }

    .moods-label {
        font-size: 0.85rem;
    }

}

.mood-tag {
    background: rgba(240, 172, 63, 0.1);
    color: var(--gold);
}

.genre-tag {
    background: rgba(155, 89, 182, 0.1);
    color: var(--gold);
}

.usage-tag {
    background: rgba(46, 204, 113, 0.1);
    color: var(--ok);
}

.characteristic-tag {
    background: rgba(230, 126, 34, 0.1);
    color: var(--gold-deep);
}

.instrument-tag {
    background: rgba(52, 73, 94, 0.1);
    color: var(--text-hi);
}

.energy-tag {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.waveform-container {
    margin: 1rem 0;
    padding: 0.5rem 0;
    position: relative;
}

.waveform {
    height: 60px;
    background: var(--line);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.waveform::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right,
    rgba(240, 172, 63, 0.1),
    rgba(240, 172, 63, 0.05)
    );
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.waveform:hover::before {
    opacity: 1;
}

.waveform-time {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 3;
}

.waveform-time span {
    background: rgba(7, 12, 20, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    color: var(--text-hi);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.tracks-container.list-view .waveform-container {
    margin: 0.5rem 0;
}

.tracks-container.list-view .waveform {
    height: 40px;
}

@media (max-width: 768px) {
    .waveform {
        height: 40px;
    }

    .waveform-container {
        margin: 0.5rem 0;
    }

}

.mobile-filter-panel.show {
    transform: translateY(0);
}

.search-row {
    gap: 1rem;
}

.mobile-filter-backdrop.show {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-filter-panel .custom-filter-dropdown.show {
        transform: translateY(0);
    }

    .search-row {
        gap: 1rem;
    }

    .mobile-filter-backdrop.show {
        display: block;
        opacity: 1;
    }

}

.song-cover img,
.song-cover .placeholder-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-cover .play-button.large {
    width: 80px;
    height: 80px;
}

.song-cover .play-button.large i {
    font-size: 2rem;
    margin-left: 5px;
}

.song-hero .waveform-container {
    margin: 2rem 0;
}

.song-hero .waveform {
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.license-button.primary {
    background: var(--gold);
    color: var(--text-hi);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.license-button.primary:hover {
    background: var(--gold-bright);
    transform: translateY(-2px);
}

.license-tab {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-mid);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.license-tab:hover {
    background-color: var(--line);
}

.license-panel {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.select-license-btn,
.get-license-btn,
.choose-membership-btn,
#confirm-acquire-license-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--gold);
    color: var(--text-hi);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.select-license-btn:hover,
.get-license-btn:hover,
.choose-membership-btn:hover,
#confirm-acquire-license-btn:hover {
    background-color: var(--gold-bright);
    transform: translateY(-2px);
}

.select-license-btn[disabled],
.get-license-btn[disabled],
.choose-membership-btn[disabled] {
    background-color: var(--ink-600);
    cursor: default;
    transform: none;
}

.choose-membership-btn,
.license-option-price > .choose-membership-btn {
    background-color: var(--ink-700);
}

.choose-membership-btn:hover,
.license-option-price > .choose-membership-btn:hover {
    background-color: var(--ink-900);
}

.license-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#membership-checkout-form .form-group {
    margin-bottom: 1.25rem;
}

.form-group.terms-group {
    display: flex;
    align-items: center;
    margin-top: 1rem;
}

#membership-checkout-form .auth-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: auto;
    font-weight: 600;
}

.more-details-toggle {
    background: transparent;
    border: none;
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 1rem;
    cursor: pointer;
    color: var(--text-mid);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    width: 100%;
}

.more-details-toggle:hover {
    color: var(--gold);
}

.more-details-toggle i {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@media (max-width: 1024px) {
    .more-details-toggle {
        justify-content: center;
    }

}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    background-color: var(--ink-900);
    color: var(--text-hi);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

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

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

.toast-message {
    margin-right: auto;
}

.toast-button {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    color: var(--text-hi);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.toast-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-hi);
}

.pricing-page {
    padding-top: 80px;
    background-color: var(--ink-850);
    padding-bottom: 5rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-low);
    transition: .4s;
    border-radius: 34px;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--ink-800);
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background-color: var(--gold);
}

.toggle-switch input:checked + label:before {
    transform: translateX(26px);
}

@media (max-width: 768px) {
    .pricing-hero {
        padding: 3rem 0;
    }

    .pricing-hero h1 {
        font-size: 2.5rem;
    }

}

#membership-choice-modal .modal-content {
    max-width: 550px;
}

#membership-choice-modal p {
    font-size: 1rem;
    color: var(--text-mid);
    margin-bottom: 1.5rem;
}

#membership-choice-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.membership-choice-option {
    position: relative;
}

.membership-choice-option input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}

.membership-choice-option label {
    display: block;
    padding: 1.25rem 1.5rem;
    border: 2px solid var(--line-strong);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 3.5rem;
}

.membership-choice-option label:before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.membership-choice-option label:after {
    content: '';
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--gold);
    transition: transform 0.2s ease;
}

.membership-choice-option input[type="radio"]:checked + label {
    border-color: var(--gold);
    background-color: var(--ink-700);
    box-shadow: 0 4px 10px rgba(240, 172, 63, 0.1);
}

.membership-choice-option input[type="radio"]:checked + label:before {
    border-color: var(--gold);
}

.membership-choice-option input[type="radio"]:checked + label:after {
    transform: translateY(-50%) scale(1);
}

.membership-choice-option label:hover {
    border-color: var(--text-mid);
}

.membership-choice-option label.disabled {
    cursor: not-allowed;
    background-color: var(--ink-850);
    border-color: var(--line);
    color: var(--text-mid);
}

.membership-choice-option label.disabled:hover {
    border-color: var(--line);
}

.membership-tier {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-hi);
    display: block;
    margin-bottom: 0.25rem;
}

.membership-tier .acquired-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-hi);
    background-color: var(--ink-700);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.membership-licensee {
    font-size: 0.9rem;
    color: var(--text-mid);
}

.modal-actions {
    text-align: right;
    margin-top: 1.5rem;
}

#confirm-acquire-license-btn.primary {
    background-color: var(--gold);
    color: var(--text-hi);
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#confirm-acquire-license-btn.primary:hover {
    background-color: var(--gold-bright);
}

.license-option-price > .choose-membership-btn {
    background-color: var(--ink-700);
}

.license-option-price > .choose-membership-btn:hover {
    background-color: var(--ink-900);
}

.choose-membership-btn {
    background: var(--ink-700);
    color: var(--text-hi);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.choose-membership-btn:hover {
    background-color: var(--ink-900);
    transform: scale(1.05);
}

.choose-membership-btn i {
    font-size: 0.9rem;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.choose-membership-btn:hover i {
    transform: translateY(2px);
}

.pagination a.current {
    background-color: var(--ink-900);
    color: var(--text-hi);
    font-weight: 700;
    cursor: default;
}

.library-sidebar .custom-filter-dropdown.show {
    display: block;
}

.sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.apply-filters-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gold);
    color: var(--text-hi);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.apply-filters-btn:hover {
    background: var(--gold-bright);
}

.tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.agreement-text,
.modal-text {
    line-height: 1.6;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 15px;
}

.agreement-text p,
.modal-text p {
    margin-bottom: 1.5em;
}

.agreement-text h2,
.modal-text h2,
.agreement-text h3,
.modal-text h3 {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    margin-bottom: 1rem;
}

.agreement-text h2:first-child,
.modal-text h2:first-child,
.agreement-text h3:first-child,
.modal-text h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.agreement-text h2,
.modal-text h2 {
    font-size: 1.5rem;
}

.agreement-text h3,
.modal-text h3 {
    font-size: 1.2rem;
}

.modal-content h2 {
    border-bottom: none;
}

.modal-content > h2 {
    border-bottom: 1px solid var(--line);
    padding-bottom: 15px;
}


/* ======================================================================
   TSMG SKIN LAYER — appended after the legacy component rules so it wins
   the cascade. New button system + modern surfaces for the pieces users
   actually touch: CTAs, cards, modals, forms, toasts, tags.
   ====================================================================== */

/* ---------------- buttons ---------------- */
.btn-gold,
.cta-button,
.checkout-btn,
.license-button.primary,
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.78rem 1.6rem;
    border: none;
    border-radius: 999px;
    background: var(--gold);
    color: var(--gold-ink) !important;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.2;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
}
.btn-gold:hover,
.cta-button:hover,
.checkout-btn:hover,
.license-button.primary:hover,
.submit-btn:hover {
    background: var(--gold-bright);
    box-shadow: 0 6px 24px var(--gold-glow);
    transform: translateY(-1px);
}
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.78rem 1.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text-hi);
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    transition: all var(--t-fast);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }
.btn-lg { padding: 0.95rem 2rem; font-size: 1.05rem; }

/* ---------------- generic modal skin ---------------- */
.modal-content,
.license-modal .modal-content {
    background: var(--ink-850);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    color: var(--text-mid);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
}
.modal h2, .modal h3, .modal-content h2, .modal-content h3 { color: var(--text-hi); }
.close-btn { color: var(--text-low); transition: color var(--t-fast); }
.close-btn:hover { color: var(--text-hi); }

/* ---------------- forms ---------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    background: var(--ink-900);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text-hi);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-low); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
select option { background: var(--ink-900); color: var(--text-hi); }

/* ---------------- toast ---------------- */
.toast {
    background: var(--ink-700);
    color: var(--text-hi);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.toast.success { border-left: 3px solid var(--ok); }
.toast.error { border-left: 3px solid var(--danger); }
.toast-button {
    background: var(--gold);
    color: var(--gold-ink);
    border-radius: 999px;
    font-weight: 700;
}

/* ---------------- category tags ---------------- */
.category-tag,
.mood-tag, .genre-tag, .usage-tag, .characteristic-tag,
.instrument-tag, .energy-tag, .cultural-influence-tag {
    background: var(--ink-700) !important;
    color: var(--text-mid) !important;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ---------------- alerts ---------------- */
.alert.success { background: var(--ok-dim); color: var(--ok); border: 1px solid rgba(62, 207, 142, 0.35); border-radius: var(--r-sm); }
.alert.error { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(242, 109, 109, 0.35); border-radius: var(--r-sm); }

/* ======================================================================
   LICENCE SELECTOR + DISCLOSURE STATES — shared component.

   Two problems this fixes.

   1. State-reveal rules lost in the styles.css split. An audit comparing
      the original stylesheet's selectors against the split files found 41
      dropped. Most were intentional (the hero, nav and feature markup was
      replaced during the redesign), but three governed components that are
      still live and are toggled by JS adding .active:
          .license-panel.active          -> licences never rendered
          .more-details-container.active -> the expander never opened
          .faq-item.active .faq-answer   -> the FAQ accordion never opened
      Without them the elements are in the DOM at max-height 0 / display
      none, so the pages look empty rather than broken.

   2. The licence modal's layout only ever existed in pages/song.css, but
      the same modal opens from the library. It lives here now so both
      pages get it.
   ====================================================================== */

/* ---------- panel / tab state ---------- */
.license-panel { display: none; }
.license-panel.active { display: flex; flex-direction: column; gap: 1.25rem; }

.license-tab.active {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink-950);
}

/* ---------- layout (previously song-only) ---------- */
.license-selector {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}
.license-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: transparent;
    padding: 0 0 1.5rem;
}
.license-tab {
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 12.5px;
    letter-spacing: 0.05em;
    padding: 8px 17px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: #C6D0E4;
    transition: all 0.2s;
}
.license-tab:hover { border-color: var(--gold); color: var(--gold); }
.license-tab-content { padding: 0; }

.license-option {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 22px 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    transition: none;
}
.license-option:hover { transform: none; box-shadow: none; border-color: rgba(255, 255, 255, 0.1); }
.license-option-info > strong,
.license-option-info h4 { font-size: 16px; font-weight: 600; color: var(--text-hi); }
.license-option-info p { font-size: 13.5px; line-height: 1.55; color: var(--text-mid); max-width: 44ch; }
.license-option-price {
    font-family: var(--font-serif);
    font-size: 26px;
    color: var(--text-hi);
}
.select-license-btn,
.get-license-btn,
.choose-membership-btn {
    display: inline-block;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 999px;
    border: 1px solid var(--paper);
    background: var(--paper);
    color: var(--ink-950);
    white-space: nowrap;
    transition: all 0.2s;
}
.select-license-btn:hover,
.get-license-btn:hover,
.choose-membership-btn:hover { background: var(--gold); border-color: var(--gold); }
.select-license-btn[disabled],
.get-license-btn[disabled],
.choose-membership-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- "more details" disclosure ---------- */
.more-details-toggle {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 13px;
    padding: 0;
}
.more-details-toggle i { transition: transform 0.3s var(--ease); }
.more-details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease), padding-top 0.3s var(--ease);
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-mid);
}
.more-details-container.active .more-details-toggle i { transform: rotate(180deg); }
.more-details-container.active .more-details-content { max-height: 1000px; padding-top: 1rem; }

/* ---------- promo strip under the licences ---------- */
.license-promo {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: var(--text-low);
}
.license-promo a { color: var(--gold); border-bottom: 1px solid var(--gold); }

/* ---------- FAQ accordion ---------- */
.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 1000px;
    opacity: 1;
}

/* ======================================================================
   DESIGN-SYSTEM PRIMITIVES — shared page furniture.

   Promoted here so the remaining pages need markup + a thin skin rather
   than a private copy of the same header/form/button/table rules.
   ====================================================================== */

/* ---------------- page header (includes/page-header-partial.php) ------ */
.page-header {
    background: linear-gradient(180deg, #060D1F 0%, #0A1733 100%);
    color: var(--text-hi);
    /* the design's 170px top, minus the 72px body already offsets for the nav */
    padding: 98px 0 72px;
    text-align: left;
}
.page-header .kicker { display: block; margin-bottom: 22px; }
.page-header h1 {
    font-size: clamp(40px, 5.2vw, 72px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0 0 18px;
    color: var(--text-hi);
}
.page-header p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-mid);
    max-width: 56ch;
    margin: 0;
}
.page-header.is-narrow .container { max-width: 940px; }

/* ---------------- form controls (Contact design treatment) ----------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-low);
}
.field input,
.field select,
.field textarea,
.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0;
    padding: 13px 16px;
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--text-hi);
    outline: none;
    box-sizing: border-box;
    width: 100%;
    text-transform: none;
    letter-spacing: normal;
    transition: border-color var(--t-fast);
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: none;
}
.field textarea, .form-group textarea { resize: vertical; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-low);
}

/* ---------------- buttons (promoted from home.css) ------------------- */
.btn-paper {
    display: inline-block;
    background: var(--paper);
    color: var(--ink-950);
    font-size: 15px;
    font-weight: 500;
    padding: 14px 32px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--font-body);
    text-align: center;
    transition: background var(--t-fast), color var(--t-fast);
}
.btn-paper:hover { background: var(--gold); color: var(--ink-950); }
.btn-line {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-hi);
    font-size: 15px;
    padding: 13px 32px;
    border-radius: 999px;
    cursor: pointer;
    background: transparent;
    font-family: var(--font-body);
    text-align: center;
    transition: border-color var(--t-fast), color var(--t-fast);
}
.btn-line:hover { border-color: var(--gold); color: var(--gold); }

/* the legacy auth/submit buttons adopt the same shape */
.auth-button,
.submit-button,
.place-order-btn,
.checkout-btn,
.browse-button,
.action-button {
    display: inline-block;
    background: var(--paper);
    color: var(--ink-950);
    border: none;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    padding: 14px 32px;
    cursor: pointer;
    text-align: center;
    transition: background var(--t-fast);
}
.auth-button:hover,
.submit-button:hover,
.place-order-btn:hover,
.checkout-btn:hover,
.browse-button:hover,
.action-button:hover { background: var(--gold); color: var(--ink-950); }
.auth-button.secondary {
    background: transparent;
    color: var(--text-hi);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.auth-button.secondary:hover { border-color: var(--gold); color: var(--gold); background: transparent; }

/* ---------------- alerts (both legacy conventions) ------------------- */
.alert-message,
.alert {
    padding: 14px 18px;
    border-radius: 0;
    font-size: 14px;
    margin-bottom: 20px;
    border-left: 3px solid transparent;
}
.alert-message.success, .alert.success {
    background: var(--ok-dim);
    color: var(--ok);
    border-left-color: var(--ok);
}
.alert-message.error, .alert.error {
    background: var(--danger-dim);
    color: var(--danger);
    border-left-color: var(--danger);
}

/* ---------------- 404 ---------------- */
.notfound-page {
    background: linear-gradient(180deg, #060D1F 0%, #0A1733 100%);
    min-height: 100vh;
}
.notfound-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 120px;
}

/* ============================================================================
   Cart popup
   Replaces cart.php. Markup in header.php, behaviour in assets/js/cart-popup.js.
   Anchored under the header button, per the cart block in Library.dc.html.
   ========================================================================= */

.cart-widget { position: relative; display: flex; align-items: center; }

.cart-panel {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 120;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #0D1C3E;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    padding: 26px 28px;
    box-sizing: border-box;
    color: var(--text-hi);
    text-align: left;
}
.cart-panel[hidden] { display: none; }

.cart-panel-kicker {
    font-size: 11px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 18px;
}

.cart-panel-loading { font-size: 13.5px; color: var(--text-faint); }

.cart-empty-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 22px;
    color: var(--gold);
    margin-bottom: 8px;
}
.cart-empty-note { font-size: 13.5px; color: var(--text-mid); line-height: 1.55; }
.cart-empty-note a { color: var(--gold); border-bottom: 1px solid rgba(159, 187, 234, 0.5); text-decoration: none; }

/* Long carts scroll inside the panel rather than running off the viewport. */
.cart-rows { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }

.cart-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cart-row-main { min-width: 0; }
.cart-row-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-hi);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-row-title:hover { color: var(--gold); }
.cart-row-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.cart-row-side { display: flex; align-items: center; gap: 10px; }
.cart-row-price { font-size: 14px; font-variant-numeric: tabular-nums; }
.cart-row-remove {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    color: #5A6B8F;
    padding: 0 2px;
    cursor: pointer;
    transition: color .2s;
}
.cart-row-remove:hover { color: #E8A0A0; }
.cart-row-remove:disabled { opacity: 0.4; cursor: default; }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0 18px;
    font-size: 15px;
    font-weight: 600;
}
.cart-total span:last-child { font-variant-numeric: tabular-nums; }

.cart-checkout {
    display: block;
    text-align: center;
    background: var(--text-hi);
    color: var(--ink-950);
    font-size: 14.5px;
    font-weight: 500;
    padding: 13px 0;
    border-radius: 999px;
    text-decoration: none;
    transition: background .2s;
}
.cart-checkout:hover { background: var(--gold); color: var(--ink-950); }

/* The cart button was an <a>; it is a <button> now so it can toggle. */
button.cart-icon-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

@media (max-width: 480px) {
    /* Anchoring to the button would push it off-screen on a narrow viewport. */
    .cart-panel {
        position: fixed;
        top: calc(var(--header-h) + 8px);
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }
}
