/**
 * Mon Livre & Livre Personnalisé Stylesheet
 * assets/css/book.css
 *
 * Covers both the interactive builder (/mon-livre/) and
 * the public illustrated storybook showcase (/livre-coloriage-personnalise/).
 *
 * @package JeuColoriage_V2
 */

/* ==========================================================================
   1. GLOBAL CONTAINER & SHARED TOKENS
   ========================================================================== */
.book-app-page,
.ml-landing-page {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    min-height: calc(100vh - 120px);
    overflow-x: hidden;
}

.book-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .book-container {
        padding: 0 1rem;
    }
}

/* ==========================================================================
   2. BUILDER APP HEADER & STEP NAVIGATION (/mon-livre/)
   ========================================================================== */
.book-app-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.book-app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.book-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.book-header-icon {
    font-size: 2rem;
    line-height: 1;
}

.book-header-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.book-header-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
    display: none;
}

@media (min-width: 768px) {
    .book-header-subtitle {
        display: block;
    }
}

.book-steps-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.book-step-btn {
    background: none;
    border: none;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.book-step-btn .step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.book-step-btn.is-active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.book-step-btn.is-active .step-num {
    background: #0284c7;
    color: #ffffff;
}

.book-step-btn.is-completed .step-num {
    background: #10b981;
    color: #ffffff;
}

.step-divider {
    width: 12px;
    height: 2px;
    background: #cbd5e1;
    display: inline-block;
}

.book-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .book-app-header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .book-steps-nav {
        justify-content: space-between;
        width: 100%;
    }
    .book-step-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   3. BUILDER STEP PANELS
   ========================================================================== */
.book-step-panel {
    padding: 2.5rem 0 5rem;
}

.book-empty-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 3.5rem 2rem;
    text-align: center;
    max-width: 760px;
    margin: 1rem auto 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.book-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.book-empty-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 1rem;
}

.book-empty-card p {
    color: #475569;
    font-size: 1.0625rem;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.book-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

/* ==========================================================================
   4. CATALOG BROWSER & UNIVERSES GRID
   ========================================================================== */
.catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.catalog-breadcrumb {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #64748b;
}

.catalog-breadcrumb .crumb-link {
    color: #0284c7;
    text-decoration: none;
}

.catalog-breadcrumb .crumb-link:hover {
    text-decoration: underline;
}

.catalog-breadcrumb .crumb-sep {
    margin: 0 0.5rem;
    color: #94a3b8;
}

.catalog-breadcrumb .crumb-active {
    color: #0f172a;
}

.catalog-search-wrap {
    flex: 1;
    min-width: 260px;
    max-width: 480px;
}

.catalog-search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.catalog-search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.view-header {
    margin-bottom: 2rem;
}

.view-header h2 {
    font-size: 1.625rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.view-header p {
    color: #64748b;
    margin: 0;
    font-size: 1rem;
}

.view-header--nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.view-header--nav h2 {
    margin: 0;
    flex: 1;
}

.view-header-count {
    font-size: 0.875rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

/* Universes Grid */
.universe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.universe-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.universe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    border-color: #0284c7;
}

.universe-card-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: #f8fafc;
}

.universe-card-placeholder {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.universe-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.universe-card-badge {
    display: inline-block;
    font-size: 0.8125rem;
    color: #0284c7;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.universe-card-cats {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: #0284c7;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.category-card-thumb-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1rem;
}

.category-card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-thumb-placeholder {
    font-size: 2.25rem;
}

.category-card-universe-badge {
    display: inline-block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0284c7;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.category-card-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.375rem;
    line-height: 1.3;
}

.category-card-count {
    font-size: 0.75rem;
    color: #64748b;
}

/* Images Grid & Selector */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
    margin-bottom: 4rem;
}

.image-picker-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.image-picker-card:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
}

.image-picker-card.is-selected {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.image-picker-card.is-in-book {
    opacity: 0.6;
    cursor: default;
    background: #f8fafc;
}

.image-picker-thumb {
    width: 100%;
    aspect-ratio: 1 / 1.3;
    padding: 0.75rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.image-picker-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-picker-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.image-picker-card.is-selected .image-picker-check {
    background: #0284c7;
    color: #ffffff;
}

.image-picker-badge-inbook {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #334155;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.image-picker-title {
    padding: 0.5rem 0.75rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid #f1f5f9;
}

/* Sticky Selection Footer */
.catalog-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid #cbd5e1;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.catalog-sticky-footer.is-visible {
    transform: translateY(0);
}

.selection-bar-info {
    display: flex;
    flex-direction: column;
}

.selection-bar-info strong {
    font-size: 1rem;
    color: #0f172a;
}

.selection-bar-info span {
    font-size: 0.8125rem;
    color: #64748b;
}

/* ==========================================================================
   5. STEP 2: ORGANIZER LAYOUT & DRAG/DROP
   ========================================================================== */
.book-organizer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .book-organizer-grid {
        grid-template-columns: 1fr 340px;
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.625rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.375rem;
}

.panel-header p {
    color: #64748b;
    margin: 0;
    font-size: 0.9375rem;
}

.book-page-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.book-page-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.book-page-card:active {
    cursor: grabbing;
}

.book-page-card.is-dragging {
    opacity: 0.4;
    border-color: #0284c7;
}

.book-page-card.drag-over {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px #0284c7;
}

.book-page-thumb-container {
    width: 100%;
    aspect-ratio: 1 / 1.35;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.book-page-thumb-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.book-cover-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #0284c7;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.tracing-preview-thumb {
    padding: 1rem;
    text-align: center;
}

.tracing-preview-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    display: block;
}

.tracing-preview-label {
    font-size: 0.6875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.book-page-info {
    margin: 0.75rem 0 0.5rem;
    display: flex;
    flex-direction: column;
}

.book-page-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0284c7;
}

.book-page-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-page-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.5rem;
}

.btn-page-move,
.btn-page-delete {
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
    transition: background 0.15s, color 0.15s;
}

.btn-page-move:hover:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-page-move:disabled {
    opacity: 0.3;
    cursor: default;
}

.btn-page-delete {
    color: #ef4444;
}

.btn-page-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Sidebar Settings Card */
.book-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    margin-bottom: 1.25rem;
}

.book-card--subtle {
    background: #f8fafc;
    border-style: dashed;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1.25rem;
}

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

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9375rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.settings-meta-info {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
    background: #f0f9ff;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   6. STEP 3: PREVIEW & PDF EXPORT
   ========================================================================== */
.book-preview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .book-preview-grid {
        grid-template-columns: 1fr 340px;
    }
}

.book-preview-viewport {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.book-page-sheet {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1 / 1.414; /* Standard A4 ratio */
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Sheet Cover Mode */
.sheet-cover {
    padding: 2rem;
    border: 8px double #cbd5e1;
}

.cover-inner-frame {
    border: 2px solid #0284c7;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
}

.cover-brand {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0284c7;
}

.cover-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0.75rem 0 0.25rem;
    line-height: 1.2;
}

.cover-author {
    font-size: 1rem;
    color: #475569;
    margin: 0 0 0.5rem;
}

.cover-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
    margin: 0;
}

.cover-illustration-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 1rem 0;
}

.cover-illustration {
    max-width: 80%;
    max-height: 220px;
    object-fit: contain;
}

.cover-footer-badge {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sheet Interior Mode */
.sheet-interior {
    padding: 1.5rem;
}

.sheet-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sheet-header-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.sheet-coloring-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.sheet-coloring-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sheet-story-caption {
    background: #f8fafc;
    border-left: 3px solid #0284c7;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    color: #334155;
    line-height: 1.5;
    margin-top: 0.5rem;
}

.sheet-footer-bottom {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.5rem;
}

.book-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.book-preview-counter {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    min-width: 120px;
    text-align: center;
}

.preview-thumbs-carousel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem 0.25rem 0.25rem;
    margin-top: 1rem;
}

.preview-thumb-btn {
    flex: 0 0 54px;
    height: 72px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.preview-thumb-btn img {
    width: 100%;
    height: 48px;
    object-fit: contain;
}

.preview-thumb-btn small {
    font-size: 0.625rem;
    font-weight: 700;
    color: #64748b;
}

.preview-thumb-btn.is-active {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.export-features {
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.export-feat {
    font-size: 0.8125rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.book-status-msg {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    min-height: 1.2rem;
}

.book-status-msg.status-success { color: #16a34a; }
.book-status-msg.status-error { color: #dc2626; }
.book-status-msg.status-info { color: #0284c7; }

/* ==========================================================================
   7. PUBLIC LANDING PAGE STYLES (/livre-coloriage-personnalise/)
   ========================================================================== */
.ml-hero {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 4rem 0 3.5rem;
    text-align: center;
}

.ml-hero-inner {
    max-width: 900px;
}

.ml-hero-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.ml-hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .ml-hero-title {
        font-size: 1.875rem;
    }
}

.ml-hero-subtitle {
    font-size: 1.125rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.ml-hero-ctas {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.ml-trust-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.ml-trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    font-weight: 600;
}

.ml-section {
    padding: 4.5rem 0;
}

.section-title-wrap {
    margin-bottom: 3rem;
}

.section-title-wrap.text-center {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-kicker {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 800;
    color: #0284c7;
    margin-bottom: 0.5rem;
}

.section-title-wrap h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.75rem;
}

.section-desc {
    font-size: 1.0625rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Steps Grid */
.ml-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.ml-step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.25rem 1.75rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease;
}

.ml-step-card:hover {
    transform: translateY(-4px);
}

.ml-step-number {
    position: absolute;
    top: -14px;
    left: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ml-step-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.ml-step-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.75rem;
}

.ml-step-card p {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Storybook Showcase Component ("9issa b tsawer dyalha") */
.ml-section-showcase {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.ml-storybook-viewer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.storybook-viewport {
    min-height: 480px;
}

.storybook-page-slide {
    display: none;
}

.storybook-page-slide.is-active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.storybook-page-frame {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

@media (min-width: 860px) {
    .storybook-page-frame {
        grid-template-columns: 380px 1fr;
    }
}

.storybook-page-artwork {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.storybook-page-artwork img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.storybook-page-narrative {
    display: flex;
    flex-direction: column;
}

.storybook-page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.storybook-badge {
    background: #0284c7;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.storybook-theme-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.storybook-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 1rem;
    line-height: 1.3;
}

.storybook-page-text {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 1.5rem;
}

.storybook-page-tip {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.8125rem;
    color: #92400e;
}

.storybook-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.storybook-indicator {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}

.storybook-thumbnails-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 1.25rem 0.25rem 0.5rem;
    margin-top: 1rem;
}

.sb-thumb-btn {
    flex: 0 0 68px;
    height: 82px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.sb-thumb-btn img {
    width: 100%;
    height: 52px;
    object-fit: contain;
}

.sb-thumb-btn span {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #64748b;
}

.sb-thumb-btn.is-active {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.storybook-cta-bar {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.storybook-cta-text strong {
    display: block;
    font-size: 1.125rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.storybook-cta-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

/* Features Grid */
.ml-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.ml-feat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ml-feat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.ml-feat-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.ml-feat-card p {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Comparison Table */
.ml-table-wrapper {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.ml-comparison-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9375rem;
}

.ml-comparison-table th,
.ml-comparison-table td {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.ml-comparison-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.9375rem;
}

.ml-comparison-table .col-highlight {
    background: #f0fdf4;
    color: #15803d;
    font-weight: 600;
}

.ml-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

/* Universes Grid on Landing */
.ml-universes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.ml-universe-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ml-universe-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
}

.ml-universe-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.ml-universe-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.ml-universe-badge {
    font-size: 0.75rem;
    color: #64748b;
}

/* Custom Request Section */
.ml-section-custom-request {
    background: #f1f5f9;
}

.ml-custom-request-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 900px) {
    .ml-custom-request-box {
        grid-template-columns: 1fr 1fr;
    }
}

.ml-request-intro h2 {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0.5rem 0 1rem;
}

.ml-request-intro p {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.ml-request-guarantees {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ml-req-g {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0284c7;
}

.ml-request-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.ml-form .form-row {
    margin-bottom: 1.25rem;
}

.ml-form .form-row label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.375rem;
}

.ml-form .form-row input,
.ml-form .form-row select,
.ml-form .form-row textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9375rem;
    box-sizing: border-box;
}

.ml-form .form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .ml-form .form-row-group {
        grid-template-columns: 1fr;
    }
}

.form-status-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.form-status-msg.status-success {
    background: #dcfce7;
    color: #166534;
}

.form-status-msg.status-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Editorial Content */
.ml-section-editorial {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.ml-editorial-content {
    max-width: 860px;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #334155;
}

.ml-editorial-content h2 {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 1.25rem;
}

.ml-editorial-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2rem 0 0.75rem;
}

.ml-editorial-content ul,
.ml-editorial-content ol {
    padding-left: 1.5rem;
    margin: 1rem 0 1.5rem;
}

.ml-editorial-content li {
    margin-bottom: 0.5rem;
}

/* FAQ Accordion */
.ml-faq-grid {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ml-faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ml-faq-question {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ml-faq-question::-webkit-details-marker {
    display: none;
}

.ml-faq-question::after {
    content: "+";
    font-size: 1.5rem;
    color: #0284c7;
    font-weight: 400;
}

.ml-faq-item[open] .ml-faq-question::after {
    content: "−";
}

.ml-faq-answer {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.6;
}

.ml-faq-answer p {
    margin: 0;
}

/* Final CTA */
.ml-section-cta-final {
    background: linear-gradient(180deg, #f8fafc 0%, #e0f2fe 100%);
    padding: 5rem 0;
}

.ml-section-cta-final h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.75rem;
}

.ml-section-cta-final p {
    font-size: 1.125rem;
    color: #475569;
    max-width: 600px;
    margin: 0 auto;
}
