/**
 * LeaseCraft layout shells — Marketing, Catalog, Wizard, Preview, Checkout.
 * Presentation only; does not alter funnel logic.
 */

/* ── Shared primitives ── */
.lc-shell-page {
    min-height: 100vh;
    background:
        radial-gradient(1200px 480px at 10% -10%, rgba(26, 47, 69, 0.06), transparent 60%),
        linear-gradient(180deg, var(--lc-bg-elevated) 0%, var(--lc-bg) 42%, var(--lc-bg) 100%);
    color: var(--lc-text);
}

.lc-shell-container {
    width: min(100% - 2rem, var(--lc-page-max));
    margin-inline: auto;
}

.lc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--lc-radius);
    font-family: var(--lc-font-display);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background var(--lc-duration) var(--lc-ease),
        color var(--lc-duration) var(--lc-ease),
        border-color var(--lc-duration) var(--lc-ease),
        transform var(--lc-duration) var(--lc-ease);
    cursor: pointer;
}

.lc-btn:active {
    transform: translateY(1px);
}

.lc-btn--primary {
    background: var(--lc-accent);
    color: #fff !important;
    border-color: var(--lc-accent-dark);
}

.lc-btn--primary:hover {
    background: var(--lc-accent-dark);
    color: #fff !important;
}

.lc-btn--secondary {
    background: var(--lc-surface);
    color: var(--lc-navy) !important;
    border-color: var(--lc-border-strong);
}

.lc-btn--secondary:hover {
    background: var(--lc-surface-muted);
    border-color: var(--lc-navy-soft);
}

.lc-btn--ghost {
    background: transparent;
    color: var(--lc-navy) !important;
    border-color: transparent;
}

.lc-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.lc-field__label {
    font-family: var(--lc-font-display);
    font-weight: 650;
    font-size: 0.92rem;
    color: var(--lc-charcoal);
}

.lc-field__hint {
    font-size: 0.85rem;
    color: var(--lc-muted);
}

.lc-field__control,
.lc-field input,
.lc-field select,
.lc-field textarea {
    min-height: 2.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--lc-border-strong);
    border-radius: var(--lc-radius-sm);
    background: var(--lc-surface);
    color: var(--lc-text);
    font: inherit;
}

.lc-field__control:focus,
.lc-field input:focus,
.lc-field select:focus,
.lc-field textarea:focus {
    outline: none;
    border-color: var(--lc-accent);
    box-shadow: var(--lc-focus-ring);
}

.lc-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 40;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--lc-border);
    box-shadow: 0 -6px 20px rgba(26, 31, 38, 0.06);
}

.lc-sticky-actions .lc-btn,
.lc-sticky-actions .btn {
    flex: 1 1 10rem;
}

@media (min-width: 768px) {
    .lc-sticky-actions {
        position: static;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 1rem 0 0;
    }

    .lc-sticky-actions .lc-btn,
    .lc-sticky-actions .btn {
        flex: 0 1 auto;
    }
}

/* ── MarketingShell ── */
.lc-marketing-shell .lc-brand-mark {
    font-family: var(--lc-font-display);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -0.04em;
    color: var(--lc-navy);
    line-height: 1.05;
    margin: 0 0 0.75rem;
}

.lc-marketing-shell .lc-hero-editorial {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3.5rem);
    position: relative;
}

.lc-marketing-shell .lc-hero-editorial::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(26, 47, 69, 0.04), transparent 45%),
        linear-gradient(180deg, #fff 0%, var(--lc-bg) 100%);
    z-index: -1;
}

.lc-marketing-shell .lc-hero-kicker {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lc-muted);
    margin-bottom: 0.75rem;
}

.lc-marketing-shell .lc-hero-lead {
    font-size: 1.1rem;
    max-width: 36rem;
    color: var(--lc-text-secondary);
    margin-bottom: 1.5rem;
}

.lc-marketing-shell .lc-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Document plane as visual anchor (not a floating card collage) */
.lc-doc-plane {
    background: var(--lc-paper);
    border: 1px solid var(--lc-border);
    box-shadow: var(--lc-shadow-paper);
    min-height: 280px;
    padding: 1.75rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.lc-doc-plane::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        transparent,
        transparent 27px,
        rgba(26, 47, 69, 0.04) 28px
    );
    pointer-events: none;
    opacity: 0.55;
}

.lc-doc-plane__title {
    font-family: var(--lc-font-doc);
    font-size: 1.15rem;
    color: var(--lc-navy);
    margin: 0 0 1rem;
    position: relative;
    z-index: 1;
}

.lc-doc-plane__line {
    height: 8px;
    background: rgba(26, 47, 69, 0.08);
    margin-bottom: 0.65rem;
    border-radius: 2px;
    position: relative;
    z-index: 1;
}

.lc-doc-plane__line--short {
    width: 62%;
}

@keyframes lc-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lc-motion-enter {
    animation: lc-fade-up 480ms var(--lc-ease) both;
}

.lc-motion-enter-delay {
    animation: lc-fade-up 560ms var(--lc-ease) 80ms both;
}

/* ── DocumentCatalogShell ── */
.lc-catalog-shell .lc-catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--lc-border);
    margin-bottom: 1.25rem;
}

.lc-catalog-shell .lc-catalog-list a {
    text-decoration: none;
    color: inherit;
}

.lc-catalog-shell .lc-catalog-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--lc-border);
}

.lc-catalog-shell .lc-catalog-row:hover {
    background: rgba(255, 255, 255, 0.55);
}

.lc-catalog-shell .lc-catalog-row h3 {
    font-size: 1.05rem;
    margin: 0 0 0.2rem;
    color: var(--lc-navy);
}

.lc-catalog-shell .lc-catalog-row p {
    margin: 0;
    color: var(--lc-muted);
    font-size: 0.9rem;
}

/* ── WizardLayout ── */
.lc-wizard-shell .udoc-page,
.wizard-container.lc-wizard-shell {
    max-width: calc(var(--lc-form-max) + var(--lc-wizard-aside) + 3rem);
}

.lc-wizard-shell .udoc-hero__title,
.lc-wizard-shell .wizard-title {
    font-family: var(--lc-font-display);
}

.lc-wizard-shell .wizard-actions,
.lc-wizard-shell .udoc-nav-actions,
.lc-wizard-shell .form-navigation {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.85rem 0.25rem;
    margin-top: 1rem;
    background: linear-gradient(180deg, transparent, var(--lc-bg) 18%, var(--lc-bg));
}

@media (max-width: 767.98px) {
    .lc-wizard-shell .wizard-actions .btn,
    .lc-wizard-shell .udoc-nav-actions .btn,
    .lc-wizard-shell .form-navigation .btn {
        flex: 1 1 46%;
        min-height: 2.75rem;
    }
}

/* ── PreviewLayout + LegalDocumentCanvas ── */
.lc-preview-shell .legal-document-canvas,
.legal-document-canvas {
    background: var(--lc-paper);
    color: var(--lc-text);
    font-family: var(--lc-font-doc);
    border: 1px solid var(--lc-border);
    box-shadow: var(--lc-shadow-paper);
    max-width: var(--lc-preview-max);
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    line-height: 1.55;
}

.lc-preview-shell .document-viewer,
.preview-conversion-page .document-viewer {
    background: transparent;
}

.lc-preview-shell .document-viewer__body,
.preview-conversion-page .document-viewer__body {
    background: var(--lc-paper);
    font-family: var(--lc-font-doc);
    box-shadow: var(--lc-shadow-paper);
    border: 1px solid var(--lc-border);
    border-radius: 0;
}

.lc-preview-shell .preview-mobile-cta,
.preview-conversion-page .preview-mobile-cta {
    border-top-color: var(--lc-border);
    background: rgba(255, 255, 255, 0.97);
}

/* ── CheckoutLayout ── */
.lc-checkout-shell {
    max-width: 40rem;
    margin: 2rem auto;
    padding: 1.5rem;
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius-lg);
    box-shadow: var(--lc-shadow-md);
}

.lc-checkout-shell h1 {
    font-family: var(--lc-font-display);
    color: var(--lc-navy);
    font-size: 1.5rem;
}

.lc-checkout-shell .lc-checkout-note {
    color: var(--lc-muted);
    font-size: 0.95rem;
}

/* Visually hidden but focusable skip already used; reinforce AA contrast helpers */
.lc-a11y-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Edge states (resume, history, expired, mismatch) ── */
.lc-edge-panel {
    max-width: var(--lc-page-max);
    margin-inline: auto;
}

.lc-edge-card {
    background: var(--lc-surface);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius-lg);
    box-shadow: var(--lc-shadow);
    padding: 1.75rem 1.5rem;
}

.lc-edge-note {
    background: var(--lc-accent-soft);
    color: var(--lc-charcoal);
    border-radius: var(--lc-radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.lc-edge-meta {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.lc-edge-meta dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lc-muted);
    margin: 0;
}

.lc-edge-meta dd {
    margin: 0.15rem 0 0;
    font-weight: 600;
    color: var(--lc-navy);
}

.lc-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lc-history-list__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--lc-border);
}

.lc-history-list__item a.h5,
.lc-history-list__item h2 a {
    color: var(--lc-navy);
    text-decoration: none;
}

.lc-history-list__item a.h5:hover,
.lc-history-list__item h2 a:hover {
    text-decoration: underline;
}

/* Soften readiness score presentation on preview */
.lc-preview-shell .ar-readiness__score {
    font-size: 0.9rem;
    color: var(--lc-muted);
}

/* Editorial type rows (hero pages — replace dashboard cards) */
.lc-type-row {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--lc-border);
}

.lc-type-row:first-of-type {
    border-top: 1px solid var(--lc-border);
}

.lc-related-list {
    margin: 0;
    padding-left: 1.1rem;
}

.lc-related-list a {
    color: var(--lc-navy);
    font-weight: 600;
}

/* Shared DIY disclaimer on conversion path */
.lc-shell .legal-trust-disclaimer,
.lc-checkout-shell .legal-trust-disclaimer,
.lc-preview-shell .legal-trust-disclaimer {
    background: var(--lc-surface-muted);
    color: var(--lc-text-secondary);
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
    padding: 1rem 1.15rem;
}

.lc-shell .legal-trust-disclaimer h2,
.lc-checkout-shell .legal-trust-disclaimer h2 {
    color: var(--lc-navy);
    font-family: var(--lc-font-display);
}

/* Checkout primary actions align with shell buttons */
.lc-checkout-shell .btn-primary,
.lc-checkout-shell .btn-success {
    background: var(--lc-accent);
    border-color: var(--lc-accent-dark);
    color: #fff;
    font-weight: 700;
    min-height: 2.75rem;
    border-radius: var(--lc-radius);
}

.lc-checkout-shell .btn-primary:hover,
.lc-checkout-shell .btn-success:hover {
    background: var(--lc-accent-dark);
    border-color: var(--lc-accent-dark);
    color: #fff;
}

.lc-checkout-shell .btn-outline-primary,
.lc-checkout-shell .btn-outline-secondary {
    border-color: var(--lc-border-strong);
    color: var(--lc-navy);
    min-height: 2.75rem;
    border-radius: var(--lc-radius);
    font-weight: 600;
}

/* Focus visibility on shell interactive controls */
.lc-shell a:focus-visible,
.lc-shell button:focus-visible,
.lc-shell input:focus-visible,
.lc-shell select:focus-visible,
.lc-shell textarea:focus-visible,
.lc-btn:focus-visible {
    outline: none;
    box-shadow: var(--lc-focus-ring);
}
