/* ============================================================
   CAVITY WEBSITE STYLES

   Homepage order:
   HERO -> PRICING -> SERVICES / WHO WE HELP -> DATA BREACH CHECK
   -> HOW IT WORKS -> SUPPORT REQUEST FORM

   Editing guide:
   - Change site colours in section 1 (:root).
   - Change header and menu appearance in section 3.
   - Change each homepage section in sections 4 to 9.
   - Change the footer in section 10.
   - Change the FAQ page in section 11.
   - Change mobile behaviour in section 12.
   ============================================================ */


/* ============================================================
   1. GLOBAL SETTINGS
   ============================================================ */

/* Makes padding and borders count inside an element's total width. */
* {
    box-sizing: border-box;
}

/* Stores the main colours used throughout the website. */
:root {
    /* Main blue used for buttons, links and accents. */
    --blue: #1058bc;

    /* Dark navy used for headings and dark sections. */
    --navy: #082b67;

    /* Green used for checks, highlights and accents. */
    --green: #80c40b;

    /* Main colour used for normal body text. */
    --ink: #1f2937;

    /* Colour used for secondary/muted text. */
    --muted: #536273;

    /* Colour used for borders and dividers. */
    --line: #dce5ef;

    /* Light blue background used on pale sections. */
    --pale: #f4f8fc;

    /* Light green background used for contact-related areas. */
    --contact-pale: #eff9df;

    /* Main white colour used for backgrounds and text on dark areas. */
    --white: #ffffff;
}

/* Makes links between sections scroll smoothly instead of jumping. */
html {
    scroll-behavior: smooth;
}

/* Removes the browser's default body margin. */
body {
    margin: 0;

    /* Sets the default website font. */
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Sets the default text colour. */
    color: var(--ink);

    /* Controls the default spacing between lines of text. */
    line-height: 1.65;
}

/* Sets the default colour of links. */
a {
    color: var(--blue);
}

/* Controls the colour and line height of all main headings. */
h1,
h2,
h3 {
    color: var(--navy);
    line-height: 1.15;
}

/* Controls the main homepage heading size, spacing and letter spacing. */
h1 {
    margin: 0.1em 0 0.35em;
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    letter-spacing: -0.04em;
}

/* Controls the size and spacing of section headings. */
h2 {
    margin: 0.15em 0 0.45em;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.025em;
}

/* Controls the small uppercase label displayed above headings. */
.eyebrow {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Controls the larger introductory/description text below headings. */
.lead {
    color: var(--muted);
    font-size: 1.2rem;
}


/* ============================================================
   2. SHARED LAYOUT AND COMPONENTS
   ============================================================ */

/* Controls the maximum width of most website content. */
.wrap {
    width: min(1120px, calc(100% - 38px));
    margin: auto;
}

/* Controls the narrower width used for FAQ and similar content. */
.narrow {
    width: min(780px, calc(100% - 38px));
    margin: auto;
}

/* Controls the standard top and bottom spacing of website sections. */
.section {
    padding: 82px 0;
}

/* Hides the accessibility skip link until it receives keyboard focus. */
.skip {
    position: absolute;
    left: -9999px;
}

/* Controls how the accessibility skip link appears when focused. */
.skip:focus {
    top: 10px;
    left: 10px;
    z-index: 99;
    padding: 10px;
    background: var(--white);
}

/* Controls the standard appearance of all buttons. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: var(--white);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

/* Changes the button colour when the mouse hovers over it. */
.btn:hover {
    background: var(--navy);
}

/* Controls the visible keyboard focus outline for buttons and form controls. */
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 3px;
}

/* Controls the smaller version of a button. */
.btn.small {
    padding: 11px 15px;
}

/* Controls buttons using the secondary/white style. */
.btn.secondary {
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--navy);
}

/* Makes a button stretch across the full available width. */
.btn.block {
    width: 100%;
}


/* ============================================================
   3. HEADER AND NAVIGATION
   ============================================================ */

/* Controls the main header bar, including its sticky position and border. */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}

/* Controls the layout, height and alignment of the navigation area. */
.nav {
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
}

/* Controls the size of the logo inside the navigation. */
.nav > a img {
    display: block;
    width: 190px;
    height: auto;
}

/* Controls the desktop navigation layout and spacing between links. */
.nav nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Controls the appearance of normal desktop navigation links. */
.nav nav > a:not(.btn) {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

/* Hides the mobile menu button on desktop screens. */
.menu {
    display: none;
}


/* ============================================================
   4. HERO
   ============================================================ */

/* Controls the hero section's spacing and gradient background. */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f9ff, #ffffff 55%, #eff9df);
}

/* Controls the two-column layout of the hero content. */
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 55px;
    align-items: center;
}

/* Controls the blue information card on the right side of the hero. */
.hero aside {
    padding: 34px;
    border-radius: 22px;
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 20px 50px #082b6724;
}

/* Controls the heading inside the hero information card. */
.hero aside h2 {
    color: var(--white);
    font-size: 1.5rem;
}

/* Removes default list spacing and bullets from the hero information list. */
.hero aside ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Controls individual items inside the hero information list. */
.hero aside li {
    padding: 10px 0;
    border-bottom: 1px solid #ffffff24;
}

/* Adds the green tick icon before hero and tick-list items. */
.hero aside li::before,
.ticks li::before {
    margin-right: 9px;
    color: var(--green);
    font-weight: 900;
    content: "✓";
}

/* Controls the layout and spacing of hero action buttons. */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0;
}

/* Controls the small tick/check list underneath the hero buttons. */
.ticks {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0;
    padding: 0;
    color: var(--muted);
    font-weight: 700;
    list-style: none;
}


/* ============================================================
   5. PRICING
   ============================================================ */

/* Controls sections that use the pale background colour. */
.pale {
    background: var(--pale);
}

/* Controls the two-column layout and spacing of pricing cards. */
.cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 55px;
    width: 100%;
}

/* Controls the basic appearance and layout of each pricing/service card. */
.cards article {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--white);
}

/* Adds the blue highlighted border to the featured pricing card. */
.cards .featured {
    border: 2px solid var(--blue);
}

/* Controls the indentation of bullet lists inside cards. */
.cards ul {
    padding-left: 20px;
}

/* Controls the appearance and size of pricing amounts. */
.price {
    margin: 7px 0;
    color: var(--navy);
    font-size: 2.2rem;
    font-weight: 900;
}

/* Controls the smaller text displayed beside or below the price. */
.price span {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 500;
}

/* Controls the position and appearance of the pricing badge. */
.badge {
    position: absolute;
    top: -14px;
    right: 22px;
    padding: 5px 12px;
    border-radius: 99px;
    background: #e8f7cc;
    color: #356d00;
}

/* Controls the small terms/disclaimer text underneath the pricing cards. */
.fine {
    max-width: 900px;
    color: var(--muted);
    font-size: 0.9rem;
}


/* ============================================================
   6. SERVICES / WHO WE HELP
   ============================================================ */

/* Removes the maximum-width restriction from service cards. */
.simple {
    max-width: none;
}

/* Centered patching service below the two main cards */
#help .patching-card {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin: 30px auto 0;
    box-sizing: border-box;
}

#help .patching-card article {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

#help .patching-card ul {
    padding-left: 20px;
}

#help .patching-card li {
    margin-bottom: 12px;
}


/* ============================================================
   7. DATA BREACH CHECK
   ============================================================ */

/* Controls the overall background and text colour of the breach-check section. */
.breach-check {
    background: var(--pale);
    color: var(--ink);
}

/* Controls the left-text/right-form two-column breach-check layout. */
.breach-check-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 55px;
    align-items: center;
}

/* Controls the breach-check section heading colour. */
.breach-check h2 {
    color: var(--navy);
}

/* Controls the small eyebrow label colour in the breach-check section. */
.breach-check .eyebrow {
    color: var(--blue);
}

/* Controls the smaller privacy and explanatory text around the checker. */
.breach-privacy,
.breach-note {
    color: var(--muted);
    font-size: 0.92rem;
}

/* Controls the white card containing the breach form/action area. */
.breach-form,
.breach-action {
    position: relative;
    padding: 32px;
    border-radius: 20px;
    background: var(--white);
    color: var(--ink);
}

/* Makes the breach-check action button span the full card width. */
.breach-action .btn {
    width: 100%;
    margin-bottom: 15px;
}

/* Controls supporting paragraph text inside the breach action card. */
.breach-action p {
    color: var(--muted);
}

/* Controls the text link used within the breach action card. */
.breach-action .text-link {
    color: var(--blue);
    font-weight: 800;
}

/* Adds spacing above the breach-check consent area. */
.breach-consent {
    margin-top: 16px;
}

/* Hides breach results until JavaScript makes them visible. */
.breach-result {
    display: none;
    margin-top: 18px;
    padding: 18px;
    border-radius: 12px;
}

/* Displays a breach result when it has the visible state class. */
.breach-result.is-visible {
    display: block;
}

/* Controls the background and text colour for a safe breach result. */
.breach-result.safe {
    background: #e8f7cc;
    color: #285400;
}

/* Controls the background and text colour for an exposed breach result. */
.breach-result.exposed {
    background: #fff0dd;
    color: #713b00;
}

/* Controls the background and text colour for a checker error. */
.breach-result.error {
    background: #fde8e8;
    color: #8a1c1c;
}

/* Controls the heading inside breach-check result messages. */
.breach-result h3 {
    margin: 0 0 8px;
    color: inherit;
}

/* Controls the list indentation inside breach-check results. */
.breach-result ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

/* Adds spacing above buttons inside breach-check result messages. */
.breach-result .btn {
    margin-top: 16px;
}

/* Controls the small XposedOrNot credit underneath the checker. */
.breach-credit {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    text-align: center;
}


/* ============================================================
   8. HOW IT WORKS
   ============================================================ */

/* Controls dark sections such as the "How it works" section. */
.dark {
    background: var(--navy);
    color: var(--white);
}

/* Makes headings inside dark sections white. */
.dark h2 {
    color: var(--white);
}

/* Makes the eyebrow label lighter blue against the dark background. */
.dark .eyebrow {
    color: #8fcbff;
}

/* Controls the three-column layout of the process steps. */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Controls the layout of each individual process step. */
.steps li {
    display: flex;
    gap: 14px;
}

/* Controls the circular numbered badge for each step. */
.steps b {
    display: grid;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    color: var(--navy);
    place-items: center;
}

/* Controls the vertical layout of the step heading and description. */
.steps span {
    display: flex;
    flex-direction: column;
}

/* Controls the smaller supporting text underneath each step. */
.steps small {
    color: #c9d7e5;
}


/* ============================================================
   9. SUPPORT REQUEST FORM
   ============================================================ */

/* Controls the background colour of the support/contact section. */
.contact {
    background: var(--pale);
}

/* Controls the left-text/right-form layout of the contact section. */
.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 55px;
}

/* Controls the appearance of the support request form card. */
.contact form {
    padding: 32px;
    border-radius: 22px;
    background: var(--white);
    box-shadow: 0 15px 45px #082b6718;
}

/* Controls fields that are displayed side-by-side in two columns. */
.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Controls the appearance and spacing of form labels. */
label {
    display: block;
    margin-bottom: 15px;
    font-weight: 750;
}

/* Controls the standard appearance of text inputs, dropdowns and text areas. */
input,
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #bdcbe0;
    border-radius: 10px;
    background: var(--white);
    font: inherit;
}

/* Controls whether the textarea can be resized vertically. */
textarea {
    resize: vertical;
}

/* Controls the layout of the consent checkbox and its text. */
.consent {
    display: flex;
    gap: 10px;
    font-weight: 500;
}

/* Prevents the consent checkbox itself from stretching to full width. */
.consent input {
    width: auto;
    margin-top: 6px;
}

/* Hides the anti-spam honeypot field from normal visitors. */
.honeypot {
    position: absolute;
    left: -10000px;
}

/* Removes the default bottom spacing from status messages. */
.status {
    margin-bottom: 0;
}

/* Controls the colour of successful form status messages. */
.status.success {
    color: #116149;
}

/* Controls the colour of form error messages. */
.status.error {
    color: #9b1c1c;
}


/* ============================================================
   10. FOOTER
   ============================================================ */

/* Controls the footer background, text colour and vertical spacing. */
footer {
    padding: 36px 0;
    background: #061c42;
    color: #d8e3ef;
}

/* Controls the footer's three-column layout and alignment. */
.footer {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 35px;
    align-items: center;
}

/* Controls the size and appearance of the footer logo. */
.footer img {
    width: 130px;
    height: auto;
    filter: none;
}

/* Controls the spacing between footer navigation links. */
.footer nav {
    display: flex;
    gap: 18px;
}

/* Controls the colour of links inside the footer. */
.footer a {
    color: var(--white);
}


/* ============================================================
   11. FAQ PAGE
   ============================================================ */

/* Controls the FAQ page's introductory hero background and spacing. */
.faqhero {
    padding: 75px 0;
    background: linear-gradient(135deg, #f5f9ff, #eff9df);
}

/* Adds a divider between each FAQ question. */
.faqs details {
    border-bottom: 1px solid var(--line);
}

/* Controls the spacing, colour and appearance of FAQ questions. */
.faqs summary {
    padding: 20px 38px 20px 0;
    color: var(--navy);
    font-weight: 850;
    cursor: pointer;
}

/* Controls the appearance of the answer text beneath FAQ questions. */
.faqs details p {
    margin-top: 0;
    color: var(--muted);
}

/* Controls the spacing above the FAQ call-to-action button. */
.faqs .btn {
    margin-top: 35px;
}


/* ============================================================
   12. MOBILE RESPONSIVE SETTINGS

   Applies at 800px wide and below.
   ============================================================ */

@media (max-width: 800px) {

    /* Shows the mobile menu button on smaller screens. */
    .menu {
        display: block;
        padding: 9px 12px;
        border: 1px solid var(--line);
        border-radius: 9px;
        background: var(--white);
        font-weight: 800;
    }

    /* Controls the hidden mobile navigation panel. */
    .nav nav {
        position: absolute;
        top: 78px;
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        padding: 18px;
        border-bottom: 1px solid var(--line);
        background: var(--white);
    }

    /* Shows the mobile navigation when the "open" class is added. */
    .nav nav.open {
        display: flex;
    }

    /* Changes all major multi-column layouts into a single column on mobile. */
    .hero-grid,
    .cards,
    .breach-check-grid,
    .steps,
    .contact-grid,
    .footer {
        grid-template-columns: 1fr;
    }

    /* Reduces the hero's vertical spacing on mobile. */
    .hero {
        padding: 55px 0;
    }

    /* Reduces standard section spacing on mobile. */
    .section {
        padding: 60px 0;
    }

    /* Changes two-column form rows into one column on mobile. */
    .row {
        grid-template-columns: 1fr;
    }

    /* Reduces the spacing between stacked footer elements on mobile. */
    .footer {
        gap: 18px;
    }

    /* Allows footer links to wrap onto multiple lines on small screens. */
    .footer nav {
        flex-wrap: wrap;
    }
}
