/* ============================================
   CLEARFUNERALCOSTS - UTILITIES
   Утилитарные стили и вспомогательные классы
   ============================================ */

/* DISCLAIMER STYLES */
.disclaimer-banner {
    background: rgba(245, 158, 11, 0.95);
    color: #78350f;
    padding: 16px 20px;
    text-align: center;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--soft-amber);
    font-weight: 500;
    margin-bottom: 20px;
    border-radius: 8px;
}

.disclaimer-text {
    font-weight: 500;
    line-height: 1.4;
}

/* ENHANCED CTA BUTTONS */
.enhanced-cta {
    background: var(--sage-green);
    color: var(--pure-white);
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.enhanced-cta:hover {
    background: var(--navy-primary);
    transform: translateY(-1px);
}

/* MICRO DISCLAIMER */
.micro-disclaimer {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
    padding: 5px 0;
}

.micro-disclaimer i {
    font-style: normal;
    font-weight: 700;
    color: var(--soft-amber);
    margin-right: 5px;
}

/* TRUST INDICATORS */
.trust-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.trust-item {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* COMPLIMENTARY SECTION */
.complimentary-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 48px 32px;
    margin: 48px 0;
}

.complimentary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.info-highlight {
    background: linear-gradient(to right, #f8f9fa 0%, transparent 100%);
    padding: 20px 24px;
    border-radius: 8px;
    border-left: 3px solid var(--sage-green);
    transition: all 0.3s ease;
}

.info-highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.info-highlight h4 {
    color: var(--navy-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-highlight p {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.complimentary-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
}

.social-proof {
    font-weight: 600;
    color: var(--navy-primary);
    margin-bottom: 8px;
}

.guarantee {
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

/* DETAILED GUIDANCE SECTION */
.detailed-guidance-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 48px 32px;
    margin: 48px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.guidance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin: 32px 0;
}

.section-divider {
    border-left: 3px solid #e8f4f8;
    padding-left: 24px;
    margin: 16px 0;
    position: relative;
}

.section-divider h4 {
    color: var(--navy-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.section-divider p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.comparison-note {
    color: var(--sage-green);
    font-style: italic;
    font-size: 0.9rem;
}

.guidance-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
}

.information-confidence {
    color: var(--navy-primary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

/* Mobile styles for sections */
@media (max-width: 768px) {
    .complimentary-section {
        padding: 32px 20px;
        margin: 32px 0;
    }
    
    .complimentary-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .info-highlight {
        padding: 16px 20px;
    }
    
    .detailed-guidance-section {
        padding: 32px 20px;
        margin: 32px 0;
    }
    
    .guidance-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .section-divider {
        padding-left: 20px;
    }
}

.guidance-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
}

.guidance-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 16px;
}

/* COMPLIANCE SECTION */
.compliance-section {
    background: var(--warm-grey-bg);
    padding: 40px 0;
    margin: 40px 0;
    border-top: 1px solid var(--border-subtle);
}

.compliance-content {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.compliance-title {
    color: var(--navy-primary);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.disclaimer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.disclaimer-item {
    background: var(--pure-white);
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid var(--sage-green);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: left;
}

.disclaimer-item h4 {
    color: var(--navy-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.disclaimer-item p {
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    font-size: 0.95rem;
}

.compliance-note {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.compliance-note p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* Mobile styles for compliance section */
@media (max-width: 768px) {
    .disclaimer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .disclaimer-item {
        padding: 16px;
    }
}

.compliance-content h3 {
    color: var(--navy-primary);
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.compliance-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.compliance-note {
    background: var(--pure-white);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    margin-top: 20px;
}

.compliance-note p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* DATA FRESHNESS */
.data-freshness {
    background: var(--soft-green);
    padding: 16px 24px;
    border-radius: 6px;
    margin-top: 24px;
    text-align: center;
}

.data-freshness-text {
    color: var(--navy-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* LOADING STATES */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-sage);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* SPINNER */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-sage);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* MESSAGE STYLES */
.message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid;
}

.message.success {
    background: #d1fae5;
    color: var(--success-green);
    border-color: #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: var(--error-red);
    border-color: #fca5a5;
}

.message.warning {
    background: #fef3c7;
    color: #d97706;
    border-color: #fcd34d;
}

.message.info {
    background: #dbeafe;
    color: #2563eb;
    border-color: #93c5fd;
}

/* FORM VALIDATION */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error-red);
}

.error-message {
    color: var(--error-red);
    font-size: 0.95rem;
    margin-top: 4px;
    display: block;
}

.success-message {
    color: var(--success-green);
    font-size: 0.95rem;
    margin-top: 4px;
    display: block;
}

/* FOCUS STYLES */
.focus-visible {
    outline: 2px solid var(--accent-sage);
    outline-offset: 2px;
}

/* ACCESSIBILITY */
.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;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--navy-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-weight: 600;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 6px;
}

/* PRINT STYLES */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .report-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    :root {
        --navy-primary: #1e3a5f;
        --charcoal-text: #1a202c;
        --accent-sage: #5a7a5f; /* Using brandbook color for high contrast */
        --text-muted: #1a202c;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 3px;
    }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading::after {
        animation: none;
    }
    
    .spinner {
        animation: none;
    }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    :root {
        --navy-primary: #4f46e5;
        --charcoal-text: #f9fafb;
        --accent-sage: #7a9a7f; /* Lighter sage for dark mode visibility */
        --warm-grey-bg: #1f2937;
        --pure-white: #111827;
        --text-muted: #e5e7eb; /* Improved contrast for dark mode */
    }
    
    body {
        background-color: var(--warm-grey-bg);
        color: var(--charcoal-text);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        background: var(--pure-white);
        border-color: #374151;
        color: var(--charcoal-text);
    }
}

/* UTILITY CLASSES */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }

.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.transition { transition: all 0.3s ease; }
.transition-colors { transition: color 0.3s ease, background-color 0.3s ease; }
.transition-transform { transition: transform 0.3s ease; }

/* === LEGAL PAGES STYLES === */
.legal-nav {
    background: linear-gradient(135deg, var(--navy-primary) 0%, #2a3990 100%);
    color: var(--pure-white);
    padding: 40px 0;
}

.nav-title {
    font-size: 2.2rem;
    color: var(--pure-white);
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.nav-subtitle {
    font-size: 1.1rem;
    color: var(--pure-white);
    opacity: 0.9;
    text-align: center;
    margin-bottom: 30px;
}

.nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    color: var(--pure-white);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-links a.active {
    background: var(--accent-sage);
    border-color: var(--accent-sage);
}

.nav-links a:hover:not(.active),
.nav-links a:focus:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--pure-white);
}

.service-definition-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.service-definition-title {
    font-size: 1.8rem;
    color: var(--navy-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.service-subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.main-content {
    padding: 40px 0;
    min-height: 70vh;
}

.legal-section {
    background: var(--pure-white);
    margin-bottom: 40px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 4px solid var(--accent-sage);
}

.legal-section h2 {
    color: var(--navy-primary);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--warm-grey-bg);
}

.legal-section h3 {
    color: var(--navy-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 25px 0 15px 0;
}

.legal-section h4 {
    color: var(--accent-sage);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.legal-section p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.legal-section ul,
.legal-section ol {
    margin: 15px 0 15px 30px;
}

.legal-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.highlight-box {
    background: rgba(107, 114, 128, 0.06);
    border-left: 4px solid var(--muted-blue);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.highlight-box h4 {
    color: var(--navy-primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.highlight-box p {
    color: var(--muted-blue);
    margin-bottom: 8px;
}

.contact-info {
    background: var(--warm-grey-bg);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid var(--accent-sage);
}

.contact-info strong {
    color: var(--navy-primary);
}

.back-to-top {
    text-align: right;
    margin-top: 30px;
}

.back-to-top a {
    color: var(--accent-sage);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-to-top a:hover {
    background: var(--burgundy-accent);
    color: var(--pure-white);
}

.external-link {
    color: var(--accent-sage);
    text-decoration: none;
    font-weight: 600;
}

.external-link:hover {
    text-decoration: underline;
}

.last-updated {
    font-style: italic;
    color: var(--muted-blue);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .legal-section {
        padding: 25px 20px;
    }

    .nav-title {
        font-size: 1.8rem;
    }

    .legal-section h2 {
        font-size: 1.7rem;
    }
}
