/* =========================================
   ACTUARYOS - BRAND PALETTE & DEFAULTS
   ========================================= */
:root {
    --primary-navy: #103766;
    --accent-teal: #008080;
    --accent-teal-dark: #006D77;
    --text-dark: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white); /* Ensures a clean backdrop for images */
    overflow-x: hidden;
}

button {
    font-family: 'Inter', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
header {
    padding: 30px 0;
    background: var(--white);
    border-bottom: 1px solid #eee;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Updated Logo Sizing: Making it prominent as requested */
.logo img {
    width: 300px;  
    height: auto;
    display: block;
    max-width: 100%; /* Mobile safety */
}

a.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-links a.is-active {
    color: var(--accent-teal);
    font-weight: 600;
}

.btn-primary.is-active {
    background: var(--accent-teal-dark);
    box-shadow: 0 0 0 2px rgba(0, 128, 128, 0.35);
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 40px; 
}

.nav-links a { 
    text-decoration: none; 
    color: var(--text-dark); 
    font-weight: 500; 
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-teal);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    padding: 14px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
}

.btn-primary { 
    background: var(--accent-teal); 
    color: var(--white); 
}

.btn-primary:hover { 
    background: var(--accent-teal-dark); 
}

.btn-secondary { 
    color: var(--accent-teal); 
    border: 2px solid var(--accent-teal); 
    margin-left: 10px; 
}

.btn-secondary:hover {
    background: rgba(0, 128, 128, 0.05);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    padding: 70px 20px 50px;
}

.hero-dynamic {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 60px;
    row-gap: 28px;
    transition: opacity 0.42s ease, transform 0.42s ease;
    will-change: opacity, transform;
}

/* Let grid columns shrink below intrinsic image width (prevents horizontal overflow) */
.hero-dynamic > .hero-lead,
.hero-dynamic > .hero-cta-block,
.hero-dynamic > .hero-image {
    min-width: 0;
}

.hero-lead {
    grid-column: 1;
    grid-row: 1;
}

.hero-cta-block {
    grid-column: 1;
    grid-row: 2;
}

.hero-image {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    width: 100%;
    max-width: 100%;
}

.hero-dynamic--exiting {
    opacity: 0;
    transform: translateY(14px);
}

@media (prefers-reduced-motion: reduce) {
    .hero-dynamic {
        transition: opacity 0.2s ease;
    }
    .hero-dynamic--exiting {
        transform: none;
    }
}

.hero h1 { 
    font-size: 3rem; 
    color: var(--primary-navy); 
    line-height: 1.1; 
    margin-bottom: 25px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.hero p { 
    font-size: 1.2rem; 
    margin-bottom: 0; 
    color: #555;
}

/* Hero Image Sizing & Window Effect */
.hero-image img {
    display: block;
    width: 100%;
    max-width: min(700px, 100%);
    height: auto;
    border-radius: 12px;
    /* This creates the floating UI look */
    box-shadow: 0 20px 50px rgba(16, 55, 102, 0.15); 
}

.hero-visual-interactive {
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-visual-interactive:hover {
    transform: translateY(-3px);
    box-shadow: 0 26px 56px rgba(16, 55, 102, 0.22);
}

.hero-visual-interactive:focus:not(:focus-visible) {
    outline: none;
}

.hero-visual-interactive:focus-visible {
    outline: 3px solid var(--accent-teal);
    outline-offset: 4px;
}

.trust-signals { 
    margin-top: 30px; 
    font-weight: 600; 
    color: var(--primary-navy); 
    display: flex;
    flex-wrap: nowrap;
    gap: 25px; 
}

.trust-signals span {
    white-space: nowrap;
}

/* =========================================
   PRODUCT BLURB
   ========================================= */
.blurb {
    padding: 70px 20px 48px;
    background: var(--light-bg);
}

.blurb-inner {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.blurb-inner h2 {
    font-size: 2rem;
    color: var(--primary-navy);
    margin-bottom: 25px;
    line-height: 1.2;
}

.blurb-inner p {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 18px;
    line-height: 1.8;
}

.blurb-inner p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--accent-teal-dark);
}

/* =========================================
   FEATURES / SERVICE BLOCKS
   ========================================= */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 64px 20px 100px;
}

.feature-card {
    padding: 50px 30px;
    background: #f9fbfa;
    border-radius: 12px;
    border-top: 6px solid var(--accent-teal); /* Teal accent bar */
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

/* Icon Sizing: significantly larger for clarity */
.feature-icon {
    width: 110px; 
    height: auto;
    margin: 0 auto 30px;
    display: block;
    /* Prevents pixelation and keeps background clean */
    object-fit: contain; 
}

.feature-card h3 {
    color: var(--primary-navy);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.feature-card p {
    font-size: 1rem;
    color: #666;
}

/* =========================================
   CONTACT MODAL
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 55, 102, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-overlay.is-visible {
    opacity: 1;
}

.modal-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px 44px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(16, 55, 102, 0.2);
    transform: translateY(24px);
    transition: transform 0.3s ease;
}

.modal-overlay.is-visible .modal-card {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
    color: var(--primary-navy);
    background: var(--light-bg);
}

.modal-header {
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 1.7rem;
    color: var(--primary-navy);
    margin-bottom: 6px;
}

.modal-header p {
    color: #666;
    font-size: 0.98rem;
}

.contact-form-error {
    color: #a32c2c;
    font-size: 0.9rem;
    margin: -12px 0 18px;
    padding: 10px 12px;
    background: #fdf2f2;
    border-radius: 8px;
    border: 1px solid #f0c4c4;
    line-height: 1.45;
}

.contact-form-error[hidden] {
    display: none;
}

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.btn-full:disabled,
.btn-full[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

.modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 6px;
}

.form-group label span {
    color: var(--accent-teal);
}

.form-group input,
.form-group select,
.form-group textarea {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    padding: 11px 14px;
    border: 1.5px solid #dde3ec;
    border-radius: 8px;
    color: var(--text-dark);
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #b0b8c6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-teal);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.12);
}

.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
    border-color: #d94f4f;
    box-shadow: 0 0 0 3px rgba(217, 79, 79, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23103766' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    text-align: center;
    margin-top: 6px;
    padding: 15px;
    font-size: 1rem;
}

.modal-success {
    text-align: center;
    padding: 20px 0 10px;
}

.modal-success[hidden] {
    display: none;
}

.success-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-teal);
    color: var(--white);
    font-size: 1.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-success h3 {
    color: var(--primary-navy);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.modal-success p {
    color: #666;
    font-size: 0.98rem;
    line-height: 1.6;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   HERO IMAGE LIGHTBOX
   ========================================= */
.image-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1010;
    background: rgba(16, 55, 102, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: zoom-out;
}

.image-modal-overlay[hidden] {
    display: none;
}

.image-modal-overlay.is-visible {
    opacity: 1;
}

.image-modal-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-navy);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}

.image-modal-close:hover {
    background: var(--white);
    transform: scale(1.05);
}

.image-modal-close:focus-visible {
    outline: 3px solid var(--accent-teal);
    outline-offset: 2px;
}

.image-modal-img {
    max-width: min(96vw, 1400px);
    max-height: min(88vh, 900px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .hero-visual-interactive {
        transition: none;
    }
    .hero-visual-interactive:hover {
        transform: none;
    }
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: var(--primary-navy);
    color: var(--white);
    padding: 60px 0;
    font-size: 0.95rem;
}

.footer-grid {
    display: flex;
    justify-content: center;
}

.footer-legal {
    text-align: center;
}

.footer-legal p {
    margin-bottom: 6px;
    opacity: 0.75;
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-legal p:last-child {
    margin-bottom: 0;
    opacity: 0.55;
    font-size: 0.8125rem;
}

/* =========================================
   RESPONSIVE (Mobile Tweaks)
   ========================================= */
@media (max-width: 992px) {
    .hero-dynamic {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: 28px;
        column-gap: 0;
        text-align: center;
    }

    .hero-lead {
        grid-column: 1;
        grid-row: 1;
    }

    .hero-image {
        grid-column: 1;
        grid-row: 2;
        grid-row-end: auto;
        align-self: center;
    }

    .hero-cta-block {
        grid-column: 1;
        grid-row: 3;
    }

    .features { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.25rem; }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 24px;
        row-gap: 12px;
    }
    nav {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    .logo img { width: 220px; }
    .modal-card { padding: 36px 24px; }
    .modal-form .form-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 768px) {
    header {
        padding: 20px 0;
    }

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    nav.container {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .logo {
        align-self: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 10px 14px;
        row-gap: 8px;
        font-size: 0.875rem;
    }

    nav.container > .btn-primary.open-contact-modal {
        display: none;
    }

    .hero {
        padding: 48px 16px;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    .hero-btns {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        max-width: 100%;
    }

    .hero-btns .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        margin-left: 0;
        text-align: center;
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .trust-signals {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 18px;
        row-gap: 10px;
        font-size: 0.875rem;
    }

    .trust-signals span {
        white-space: normal;
        text-align: center;
    }

    .hero-image img {
        margin-left: auto;
        margin-right: auto;
    }

    .blurb {
        padding: 48px 16px 36px;
    }

    .blurb-inner h2 {
        font-size: 1.45rem;
    }

    .features {
        padding: 44px 16px 56px;
    }

}

@media (max-width: 420px) {
    .hero h1 {
        font-size: 1.45rem;
    }

    .hero-btns {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-btns .btn {
        flex: none;
        width: 100%;
    }

    .nav-links {
        font-size: 0.8125rem;
        gap: 8px 10px;
    }

    .trust-signals {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}