/* ================================================
   CadaEuro — Minimalist Legal Pages Styles
   ================================================ */

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* Ensure html also has the dark background to prevent white showing */
    background: #0B1C1F;
    min-height: 100%;
}

body.legal-page {
    /* Use the same background as the main landing page */
    background: linear-gradient(160deg, #12494C 0%, #0B1C1F 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    color: #ffffff;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
}

/* Fallback for mobile browsers that have issues with fixed backgrounds */
@supports (-webkit-touch-callout: none) {
    body.legal-page {
        background-attachment: scroll;
    }
}

/* Header (Minimal) */
.legal-header-nav {
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.legal-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    flex-shrink: 0; /* Don't squash the logo container */
}

.legal-logo-img {
    height: 14px;
    width: auto;
    max-width: 100%; /* Ensure it doesn't overflow if very small screen */
}

.back-link {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap; /* Keep "Back" text together */
}

.back-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Main Content Container */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 40px 100px;
    width: 100%;
    box-sizing: border-box;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.2;
}

.legal-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 48px;
    margin-bottom: 16px;
    line-height: 1.3;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 24px;
    margin-bottom: 12px;
}

section {
    margin-bottom: 48px;
}

p, li {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    line-height: 1.7;
    overflow-wrap: break-word; /* Prevent long URLs from breaking layout */
    word-wrap: break-word;
}

ul {
    padding-left: 24px;
    margin-bottom: 24px;
}

li {
    margin-bottom: 8px;
}

a {
    color: #4FD1C5; /* Teal-ish accent color */
    text-decoration: none;
    transition: opacity 0.2s;
    word-break: break-word; /* Break long URLs on mobile */
}

a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Ensure links are easily tappable on mobile */
a[href^="mailto:"],
a[href^="http"] {
    min-height: 44px;
    display: inline-block;
    padding: 4px 0;
}

/* Highlight Box (for Summary/Privacy Highlights) */
.highlight-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
}

.privacy-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.privacy-highlight h3 {
    margin-top: 0;
    color: #4FD1C5;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.privacy-highlight p {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* Footer (Simple text centered) */
.legal-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
}

.legal-footer p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.4rem;
        margin-top: 40px;
    }

    .legal-container {
        padding: 32px 24px 80px;
    }

    .legal-header-nav {
        padding: 24px;
    }

    .legal-logo-img {
        height: 14px;
    }

    .privacy-highlights {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .legal-header-nav {
        padding: 16px 20px;
        gap: 12px;
    }

    .legal-logo-img {
        height: 14px;
    }

    .back-link {
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 12px;
        line-height: 1.2;
    }

    .legal-meta {
        font-size: 0.85rem;
        margin-bottom: 32px;
        padding-bottom: 20px;
    }

    h2 {
        font-size: 1.3rem;
        margin-top: 36px;
        margin-bottom: 12px;
    }

    h3 {
        font-size: 1.1rem;
        margin-top: 20px;
    }

    p, li {
        font-size: 1rem;
        line-height: 1.65;
        margin-bottom: 14px;
    }

    ul {
        padding-left: 20px;
        margin-bottom: 20px;
    }

    .highlight-box {
        padding: 20px 16px;
        margin: 24px 0;
        border-radius: 12px;
    }

    .privacy-highlights {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 20px;
    }

    .privacy-highlight h3 {
        font-size: 0.95rem;
    }

    .privacy-highlight p {
        font-size: 0.9rem;
    }

    .legal-container {
        padding: 24px 20px 60px;
    }

    .legal-footer {
        padding: 32px 20px;
        margin-top: 40px;
    }

    .legal-footer p {
        font-size: 0.85rem;
    }
}

/* Extra small screens (very small phones) */
@media (max-width: 360px) {
    .legal-header-nav {
        padding: 12px 16px;
    }

    .legal-logo-img {
        height: 18px;
    }

    .back-link {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .legal-container {
        padding: 20px 16px 50px;
    }

    .highlight-box {
        padding: 16px 12px;
    }
}
