/* =========================================
   Guides d'intégration — DescTool
   Design cohérent avec mentions-legales.php
   ========================================= */

.guide-hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 0 2rem;
    text-align: center;
}

.guide-glow {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.07) 0%, rgba(129,140,248,0.03) 50%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.guide-hero h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.guide-hero p {
    font-size: clamp(0.95rem, 1.3vw, 1.05rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Content */
.guide-content {
    max-width: 720px;
    margin: 2rem auto 4rem;
    padding: 0 1.5rem;
}

.guide-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.guide-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.guide-card h2:first-child { margin-top: 0; }

.guide-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 1.5rem 0 0.5rem;
}

.guide-card p {
    font-size: 0.925rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.75;
}

.guide-card ol,
.guide-card ul {
    margin: 0.5rem 0 1rem 1.25rem;
    list-style: none;
}

.guide-card ol li,
.guide-card ul li {
    font-size: 0.925rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.guide-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    background: var(--secondary);
    border-radius: 50%;
}

.guide-card ol {
    counter-reset: step;
}

.guide-card ol li {
    counter-increment: step;
}

.guide-card ol li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
}

.guide-card strong {
    color: var(--text);
    font-weight: 600;
}

.guide-card a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.guide-card a:hover {
    color: var(--primary-dark, #5558E6);
}

.guide-card .highlight-box {
    background: rgba(99,102,241,0.04);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.guide-card .highlight-box strong {
    color: var(--primary);
}

.guide-card .highlight-box.warning {
    border-left-color: var(--destructive, #DC2626);
}

.guide-card .highlight-box.warning strong {
    color: var(--destructive, #DC2626);
}

.guide-card .highlight-box.success {
    border-left-color: var(--accent, #059669);
}

.guide-card .highlight-box.success strong {
    color: var(--accent, #059669);
}

.guide-card .step-screenshot {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    overflow-x: auto;
}

.guide-card .step-screenshot .menu-path {
    color: var(--primary);
    font-weight: 600;
}

.guide-card .step-screenshot .token-demo {
    color: var(--accent, #059669);
    font-weight: 600;
}

.guide-card .tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.guide-card .tag.required {
    background: rgba(220,38,38,0.1);
    color: var(--destructive, #DC2626);
}

.guide-card .tag.info {
    background: rgba(99,102,241,0.1);
    color: var(--primary);
}

/* ============================
   Guide Step Cards — UI moderne
   ============================ */

.guide-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.25rem 0;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.guide-step-card:hover {
    box-shadow: var(--shadow-md);
}

.guide-step-card .guide-visual {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* Menu tree — arborescence visuelle */
.guide-step-card .menu-tree {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    line-height: 1.8;
}

.guide-step-card .menu-tree .menu-item {
    padding: 0.2rem 0 0.2rem 1.25rem;
    position: relative;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.guide-step-card .menu-tree .menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary);
    opacity: 0.5;
}

.guide-step-card .menu-tree .menu-item.active {
    color: var(--primary);
    font-weight: 600;
}

.guide-step-card .menu-tree .menu-item.active::before {
    background: var(--primary);
    opacity: 1;
    width: 8px;
    height: 8px;
    top: 0.5rem;
}

.guide-step-card .menu-tree .menu-item-root {
    padding: 0.3rem 0;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.guide-step-card .menu-tree .submenu {
    margin: 0.15rem 0 0.15rem 0.5rem;
    border-left: 2px solid var(--border);
    padding-left: 0.75rem;
}

/* Badge — chemin de navigation */
.guide-step-card .badge-path {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}

/* Form simulation */
.guide-step-card .form-sim {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-sm) - 0.15rem);
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.guide-step-card .form-sim .form-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(224,231,255,0.4);
}

.guide-step-card .form-sim .form-row:last-child {
    border-bottom: none;
}

.guide-step-card .form-sim .field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    min-width: 110px;
    flex-shrink: 0;
}

.guide-step-card .form-sim .field-input {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.4rem 0.6rem;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    word-break: break-all;
    min-height: 1.8em;
}

.guide-step-card .form-sim .field-input .placeholder {
    color: #94a3b8;
    font-style: italic;
    font-family: inherit;
}

.guide-step-card .form-sim .field-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.guide-step-card .form-sim .field-radio .radio-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: inline-block;
    position: relative;
}

.guide-step-card .form-sim .field-radio .radio-dot.active {
    border-color: var(--primary);
}

.guide-step-card .form-sim .field-radio .radio-dot.active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.guide-step-card .form-sim .field-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.guide-step-card .form-sim .field-checkbox .check-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 2px solid var(--border);
    display: inline-block;
    position: relative;
}

.guide-step-card .form-sim .field-checkbox .check-box.checked {
    border-color: var(--primary);
    background: var(--primary);
}

.guide-step-card .form-sim .field-checkbox .check-box.checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    font-size: 10px;
    color: white;
    font-weight: 700;
}

.guide-step-card .form-sim .field-checkbox .check-label.highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Buttons simulation */
.guide-step-card .sim-btn-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0 0;
    flex-wrap: wrap;
}

.guide-step-card .sim-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: default;
}

.guide-step-card .sim-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.guide-step-card .sim-btn-success {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.guide-step-card .sim-btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* Table simulation */
.guide-step-card .sim-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin: 0.5rem 0;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
}

.guide-step-card .sim-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    padding: 0.4rem 0.5rem;
    border-bottom: 2px solid var(--border);
}

.guide-step-card .sim-table td {
    padding: 0.4rem 0.5rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.guide-step-card .sim-table tr:last-child td {
    border-bottom: none;
}

/* Tab bar */
.guide-step-card .tab-bar {
    display: flex;
    gap: 0.125rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
    margin-bottom: 0.75rem;
}

.guide-step-card .tab-bar .tab-item {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: 0.35rem 0.35rem 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: default;
}

.guide-step-card .tab-bar .tab-item.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* Token display */
.guide-step-card .token-display {
    background: var(--bg-card);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 600;
    word-break: break-all;
    text-align: center;
    position: relative;
}

.guide-step-card .token-display::before {
    content: '🔑';
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Success banner */
.guide-step-card .success-banner {
    background: rgba(5,150,105,0.06);
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.guide-step-card .success-banner svg {
    vertical-align: middle;
    margin-right: 0.35rem;
}

/* Section divider inside cards */
.guide-step-card .section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.75rem 0;
}

/* Permissions grid */
.guide-step-card .permissions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
    margin: 0.5rem 0;
}

.guide-step-card .permissions-grid .perm-item {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.15rem 0;
}

.guide-step-card .permissions-grid .perm-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Warning note inside step cards */
.guide-step-card .warning-note {
    font-size: 0.78rem;
    color: var(--destructive, #DC2626);
    font-weight: 600;
    text-align: center;
    padding: 0.35rem;
    background: rgba(220,38,38,0.04);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

/* Permissions list (inside step 4 text) */
.guide-step-card .perm-list {
    margin: 0.5rem 0 0 1.25rem;
    display: grid;
    gap: 0.35rem;
}
.guide-step-card .perm-list li {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

/* Responsive cards */
@media (max-width: 600px) {
    .guide-step-card {
        padding: 1rem;
    }
    .guide-step-card .guide-visual {
        padding: 0.85rem;
    }
    .guide-step-card .form-sim .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .guide-step-card .form-sim .field-label {
        min-width: auto;
    }
    .guide-step-card .permissions-grid {
        grid-template-columns: 1fr;
    }
    .guide-step-card .sim-btn-row {
        flex-direction: column;
    }
    .guide-step-card .sim-btn {
        width: 100%;
        justify-content: center;
    }
}

.guide-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.guide-back:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .guide-card {
        padding: 1.75rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .guide-card {
        padding: 1.5rem 1.25rem;
    }
}