/* Terms & Conditions Page - Mobile-First Optimized CSS */

/* Enhanced variables for text-heavy content */
:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-lg: 16px;
}

/* Enhanced hover states for mobile-friendly interaction */
.back-link:hover,
.back-link:focus {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    outline: none;
}

.back-link:active {
    transform: translateY(0);
}

/* Content sections */
.section {
    margin-bottom: 2rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-100);
}

.section p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: justify;
}

.section p:last-child {
    margin-bottom: 0;
}

/* Enhanced list styling for legal content */
.section ul {
    color: var(--text-light);
    margin: 1rem 0 1rem 1.5rem;
    line-height: 1.6;
}

.section li {
    margin-bottom: 0.75rem;
    position: relative;
}

.section li::marker {
    color: var(--primary-color);
}

/* External links styling */
.external-links {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin: 1.5rem 0;
}

.external-links li {
    margin-bottom: 0.5rem;
}

.external-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0;
    transition: all 0.2s ease;
}

.external-links a:hover,
.external-links a:focus {
    color: var(--secondary-color);
    text-decoration: underline;
}

.external-links a::after {
    content: " ↗";
    font-size: 0.8rem;
    margin-left: 0.25rem;
    opacity: 0.6;
}

/* Contact info styling */
.contact-info {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    margin-top: 2rem;
    border: 1px solid var(--gray-200);
}

.contact-info h2 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.contact-info a:hover,
.contact-info a:focus {
    background: rgba(99, 102, 241, 0.2);
    text-decoration: underline;
}

/* Enhanced footer for mobile */
footer {
    background: #0f0f0f;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.footer-links a:hover,
.footer-links a:focus {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Print styles for legal documents */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.5;
        background: white;
    }

    header, footer {
        display: none;
    }

    .main-content {
        padding: 0;
        max-width: none;
    }

    .content-card {
        box-shadow: none;
        border: 1px solid #ccc;
        padding: 1rem;
    }

    .section {
        break-inside: avoid;
    }

    .external-links a::after {
        content: " (" attr(href) ")";
    }
}

/* Desktop enhancements */
@media (min-width: 768px) {
    .main-content {
        padding: 4rem 2rem;
    }

    .content-card {
        padding: 3rem;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .contact-info {
        padding: 2.5rem;
    }

    footer {
        padding: 3rem 2rem;
    }

    /* Hover effects only on desktop */
    .section p {
        transition: color 0.2s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-light: #374151;
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }

    .external-links {
        border-left-width: 6px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode support (experimental) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f9fafb;
        --text-light: #d1d5db;
        --text-muted: #9ca3af;
        --white: #1f2937;
        --gray-50: #111827;
        --gray-100: #1f2937;
        --gray-200: #374151;
    }

    body {
        background: var(--gray-50);
        color: var(--text-dark);
    }

    .content-card {
        background: var(--white);
        border-color: var(--gray-200);
    }
}

/* Focus management for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--border-radius);
}

/* Smooth scrolling for internal links */
html {
    scroll-behavior: smooth;
}

/* Typography improvements */
.section p {
    max-width: 65ch; /* Optimal reading width */
    hyphens: auto;
    word-break: break-word;
}

/* Loading animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.3s ease-out;
}

/* Selection styling */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-dark);
}