/* ============================================
   STYLES — Bibliothèque de résolutions d'AG
   Étend tools.css avec les composants spécifiques.
   ============================================ */

/* ---- Hero & USP banner ---- */
.library-hero h1 {
    max-width: 920px;
}

.usp-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--accent-gold-light);
    border-left: 4px solid var(--accent-gold);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.usp-banner i {
    color: var(--accent-gold-hover);
    font-size: 1.1rem;
}

/* ---- Sections ---- */
.library-section {
    padding: 3rem 0;
}

.library-section-alt {
    background: var(--light-bg);
}

.library-section h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-intro {
    text-align: center;
    color: var(--text-body);
    max-width: 720px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* ---- Grid 5 résolutions free ---- */
.resolution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.resolution-card {
    position: relative;
    display: block;
    padding: 1.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    color: var(--text-dark);
    text-decoration: none;
    transition: transform var(--motion-duration-hover) var(--motion-easing),
                box-shadow var(--motion-duration-hover) var(--motion-easing),
                border-color var(--motion-duration-hover) var(--motion-easing);
}

.resolution-card:hover,
.resolution-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-light);
}

.resolution-card h3 {
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0.5rem 0 0.75rem;
    color: var(--text-dark);
}

.resolution-card .resolution-meta,
.resolution-card .resolution-cat {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-body);
    line-height: 1.45;
}

.resolution-card .resolution-cat {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.resolution-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.resolution-badge-free {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

.resolution-badge-locked {
    background: var(--accent-gold-light);
    color: var(--accent-gold-hover);
}

/* ---- Filtres ---- */
.library-filters {
    margin-bottom: 2rem;
}

.library-search-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-body);
    margin-bottom: 0.25rem;
}

#library-search {
    width: 100%;
    max-width: 480px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

#library-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 87, 135, 0.15);
}

.library-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.library-filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--motion-duration-hover) var(--motion-easing);
}

.library-filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.library-filter-btn:focus-visible {
    outline: 3px solid var(--accent-gold-hover);
    outline-offset: 2px;
}

.library-filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ---- Resolution list (rows) ---- */
.resolution-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resolution-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--motion-duration-hover) var(--motion-easing),
                box-shadow var(--motion-duration-hover) var(--motion-easing);
}

.resolution-row:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.resolution-row.hidden {
    display: none;
}

.resolution-row-main h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    line-height: 1.35;
}

.resolution-row-main h3 a {
    color: var(--text-dark);
    text-decoration: none;
}

.resolution-row-main h3 a:hover,
.resolution-row-main h3 a:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.resolution-row-main .resolution-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.resolution-row-main .resolution-meta strong {
    color: var(--text-body);
}

.resolution-row-locked h3 .fa-lock {
    color: var(--accent-gold-hover);
    margin-right: 0.4rem;
    font-size: 0.9em;
}

.library-empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    font-style: italic;
}

/* ---- Pricing 3 tiers ---- */
.library-pricing-section {
    background: var(--white);
}

.library-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.pricing-card {
    position: relative;
    padding: 2rem 1.75rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.pricing-card-perso {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(39, 87, 135, 0.12);
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    color: var(--text-dark);
}

.pricing-price {
    margin: 0.5rem 0 1rem;
    font-size: 1.1rem;
    color: var(--text-body);
}

.pricing-price strong {
    font-size: 2.25rem;
    color: var(--primary);
    font-family: var(--font-heading);
}

.pricing-target {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex-grow: 1;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.45rem 0;
    font-size: 0.9rem;
    color: var(--text-body);
    line-height: 1.5;
}

.pricing-features i {
    color: var(--accent-gold);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.pricing-badge-soon,
.pricing-badge-included {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pricing-badge-soon {
    background: var(--accent-gold-light);
    color: var(--accent-gold-hover);
}

.pricing-badge-included {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--motion-duration-hover) var(--motion-easing);
    min-height: 44px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--primary-dark);
}

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

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: var(--primary);
    color: var(--white);
}

.btn-secondary[disabled],
.btn-secondary[aria-disabled="true"] {
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-tertiary {
    background: var(--accent-gold);
    color: var(--dark);
}

.btn-tertiary:hover,
.btn-tertiary:focus-visible {
    background: var(--accent-gold-hover);
    color: var(--white);
}

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

/* ---- Page résolution unique ---- */
.resolution-page-hero {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
}

.resolution-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.resolution-page-hero h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    line-height: 1.25;
}

.resolution-meta-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.25rem;
    margin: 0;
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    max-width: 920px;
}

.resolution-meta-bar dt {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.85rem;
}

.resolution-meta-bar dd {
    margin: 0;
    color: var(--text-body);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ---- Resolution content ---- */
.resolution-content {
    padding: 2.5rem 0;
    max-width: 920px;
}

.resolution-content h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 2rem 0 1rem;
}

.resolution-content h2:first-child {
    margin-top: 0;
}

.resolution-text {
    background: var(--light-bg);
    border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.resolution-text p {
    margin: 0 0 1em;
}

.resolution-text p:last-child {
    margin-bottom: 0;
}

.resolution-comment p {
    margin: 0 0 1em;
    color: var(--text-body);
    line-height: 1.7;
}

/* ---- Paywall ---- */
.paywall-card {
    margin: 2rem 0;
    padding: 2.5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.paywall-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: var(--accent-gold);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.paywall-card h3 {
    font-size: 1.5rem;
    color: var(--white);
    margin: 0 0 0.75rem;
}

.paywall-card > p {
    color: rgba(255, 255, 255, 0.92);
    max-width: 560px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.paywall-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.paywall-cta .btn-primary {
    background: var(--accent-gold);
    color: var(--dark);
    border-color: var(--accent-gold);
}

.paywall-cta .btn-primary:hover,
.paywall-cta .btn-primary:focus-visible {
    background: var(--accent-gold-hover);
    color: var(--white);
    border-color: var(--accent-gold-hover);
}

.paywall-cta .btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.6);
}

.paywall-cta .btn-secondary:hover,
.paywall-cta .btn-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-color: var(--white);
}

.paywall-already {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.paywall-already a {
    color: var(--accent-gold);
    text-decoration: underline;
}

/* ---- Retour bibliothèque ---- */
.resolution-back {
    padding: 1.5rem 0 3rem;
}

.btn-back {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.btn-back:hover,
.btn-back:focus-visible {
    text-decoration: underline;
}

/* ---- FAQ ---- */
.library-faq {
    background: var(--light-bg);
}

.library-faq .faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.library-faq summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    list-style: none;
    position: relative;
    padding-right: 3rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.library-faq summary::-webkit-details-marker { display: none; }

.library-faq summary::after {
    content: "+";
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform var(--motion-duration-hover) var(--motion-easing);
}

.library-faq details[open] summary::after {
    content: "−";
}

.library-faq summary:focus-visible {
    outline: 3px solid var(--accent-gold-hover);
    outline-offset: -3px;
}

.library-faq .faq-content {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-body);
    line-height: 1.6;
}

/* ---- Footer (reprise lightweight pour les pages outils) ---- */
.site-footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 2.5rem 0 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.6;
}

.site-footer a {
    color: var(--accent-gold);
    text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

/* ============================================
   WAITLIST MODE (soft launch pre-Stripe)
   ============================================ */

.pricing-badge-waitlist {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--accent-gold-light);
    color: var(--accent-gold-hover);
}

.pricing-fineprint {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
}

/* Dialog natif */
.waitlist-dialog {
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 480px;
    width: calc(100% - 2rem);
    box-shadow: var(--shadow-lg);
    background: var(--white);
    color: var(--text-dark);
}

.waitlist-dialog::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
}

.waitlist-dialog > form,
.waitlist-dialog > .waitlist-success {
    padding: 2rem 1.75rem;
}

.waitlist-dialog h2 {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.waitlist-intro {
    margin: 0 0 1.25rem;
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.5;
}

.waitlist-field {
    margin-bottom: 1rem;
}

.waitlist-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.waitlist-field input[type="email"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    background: var(--white);
    box-sizing: border-box;
    transition: border-color 0.2s var(--motion-easing),
                box-shadow 0.2s var(--motion-easing);
}

.waitlist-field input[type="email"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 87, 135, 0.15);
}

.waitlist-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.waitlist-checkbox input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    cursor: pointer;
}

.waitlist-checkbox label {
    margin: 0;
    font-size: 0.825rem;
    color: var(--text-body);
    line-height: 1.5;
    font-weight: 400;
    cursor: pointer;
}

.waitlist-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.waitlist-error {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: var(--radius-sm);
    color: #991b1b;
    font-size: 0.875rem;
}

.waitlist-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.waitlist-success {
    text-align: center;
}

.waitlist-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.waitlist-success p {
    color: var(--text-body);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

@media (max-width: 480px) {
    .waitlist-actions {
        flex-direction: column-reverse;
    }
    .waitlist-actions .btn {
        width: 100%;
    }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .library-hero h1 { font-size: 1.85rem; }
    .resolution-grid { grid-template-columns: 1fr; }
    .resolution-row { flex-direction: column; align-items: flex-start; }
    .resolution-meta-bar { grid-template-columns: 1fr; gap: 0.25rem; }
    .resolution-meta-bar dt { margin-top: 0.5rem; }
    .resolution-meta-bar dt:first-of-type { margin-top: 0; }
    .resolution-page-hero h1 { font-size: 1.75rem; }
    .paywall-card { padding: 2rem 1rem; }
    .paywall-cta { flex-direction: column; }
    .paywall-cta .btn { width: 100%; }
}
