/**
 * Lease Resiliation Agreement Styling
 * Supports modern responsive UI & formal Quebec legal document print rendering.
 */

:root {
    --resiliation-primary: #1e3a8a;
    --resiliation-primary-hover: #1e40af;
    --resiliation-secondary: #0f766e;
    --resiliation-paper-bg: #ffffff;
    --resiliation-paper-border: #e2e8f0;
    --resiliation-text: #1e293b;
    --resiliation-muted: #64748b;
}

body {
    background-color: #f8fafc;
    color: var(--resiliation-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header & Banner */
.resiliation-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}

.legal-notice-card {
    border-left: 5px solid #f59e0b;
    background-color: #fffbeb;
}

.share-banner-card {
    border-left: 5px solid var(--resiliation-primary) !important;
    background-color: #ffffff;
    transition: box-shadow 0.2s ease;
}

.share-banner-card:hover {
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.08) !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-fast {
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.legal-authority-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 9999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.825rem;
    font-weight: 600;
}

/* Form Styles */
.form-section-card {
    border: 1px solid var(--resiliation-paper-border);
    border-radius: 0.75rem;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.form-section-header {
    background-color: #f1f5f9;
    border-bottom: 1px solid var(--resiliation-paper-border);
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-section-body {
    padding: 1.25rem;
}

/* Document Paper Preview */
.contract-preview-wrapper {
    position: sticky;
    top: 1.5rem;
}

.contract-paper {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    font-family: "Georgia", Cambria, "Times New Roman", Times, serif;
    color: #0f172a;
    line-height: 1.6;
    font-size: 0.95rem;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.contract-header {
    text-align: center;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.contract-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    color: #0f172a;
}

.contract-subtitle {
    font-size: 0.9rem;
    color: #475569;
    font-style: italic;
}

.contract-clause {
    margin-bottom: 1.25rem;
    text-align: justify;
}

.contract-clause-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1e293b;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
}

.contract-highlight {
    background-color: #fef08a;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    font-weight: 600;
}

.signature-block {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #cbd5e1;
    page-break-inside: avoid;
}

.sig-box {
    border: 1px solid #cbd5e1;
    background-color: #fafaf9;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sig-image {
    max-height: 70px;
    object-fit: contain;
    display: block;
}

.sig-line {
    border-top: 1px solid #475569;
    margin-top: 1rem;
    padding-top: 0.25rem;
}

/* Signature Canvas Modal */
.signature-canvas-wrapper {
    position: relative;
    border: 2px dashed #94a3b8;
    border-radius: 0.5rem;
    background-color: #ffffff;
    cursor: crosshair;
    touch-action: none;
}

#signaturePadCanvas {
    width: 100%;
    height: 180px;
    display: block;
}

/* Real-time sync highlight */
.preview-updated {
    animation: flashHighlight 1s ease;
}

@keyframes flashHighlight {
    0% { background-color: rgba(59, 130, 246, 0.15); }
    100% { background-color: transparent; }
}

/* PRINT MEDIA STYLES - Produces pristine court/registry grade legal document */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        line-height: 1.45 !important;
    }

    /* Hide web chrome, forms, buttons, banners */
    .no-print,
    .resiliation-hero,
    .resiliation-form-col,
    .btn,
    .navbar,
    .footer,
    nav,
    header,
    #toastContainer,
    .alert {
        display: none !important;
    }

    /* Full width contract paper */
    .resiliation-preview-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .contract-preview-wrapper {
        position: static !important;
    }

    .contract-paper {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        font-size: 11pt !important;
    }

    .contract-highlight {
        background-color: transparent !important;
        font-weight: bold !important;
        text-decoration: underline !important;
    }

    .signature-block,
    .contract-disclaimer-block {
        page-break-inside: avoid !important;
    }

    @page {
        size: letter portrait;
        margin: 1.8cm 1.5cm 1.8cm 1.5cm;
    }
}
