/* 
  BrokerConnect - Structured Premium Aesthetic
*/
:root {
    --black: #000000;
    --charcoal: #111111;
    --grey-dark: #444444;
    --grey-mid: #888888;
    --grey-light: #e5e5e5;
    --grey-bg: #f8f8f8;
    --white: #ffffff;
    --font-stack: "Inter", -apple-system, sans-serif;
    --transition: all 0.3s ease;
    --blue-accent: #0A6CCE; /* Executive Blue */
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-stack);
    color: var(--black);
    background-color: var(--white);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: var(--black);
}

/* Base Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw;
}

.border-top { border-top: 1px solid var(--grey-light); }
.border-left { border-left: 1px solid var(--grey-light); }
.bg-light { background-color: var(--grey-bg); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--font-stack);
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    border-radius: 0;
    box-sizing: border-box;
    vertical-align: middle;
}

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

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-white {
    background-color: var(--white);
    color: var(--black);
}

.btn-white:hover {
    background-color: var(--grey-light);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--grey-light);
    color: var(--black);
}

.btn-outline:hover {
    border-color: var(--black);
}

.btn-sm {
    padding: 0 1.5rem;
    height: 44px;
    font-size: 0.875rem;
}

.btn-full { width: 100%; }

/* Header */
.header {
    height: 80px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--grey-light);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

.logo {
    height: 40px;
    width: auto;
    display: block;
}

.footer-logo {
    height: 48px;
    width: auto;
    display: block;
    margin-bottom: 1rem;
    filter: grayscale(100%) brightness(0);
}

.header-nav {
    text-align: center;
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    .header-grid {
        grid-template-columns: auto 1fr;
    }
}

.trust-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey-mid);
}

.header-action {
    text-align: right;
}

/* Hero Section */
.hero-section {
    padding: 6vw 0;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.8)), url('hero-bg.png');
    background-size: cover;
    background-position: center;
    color: var(--white);
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 6rem;
        align-items: start;
    }
}

.display-title {
    font-size: clamp(2.5rem, 4vw, 3.75rem);
    margin-bottom: 2rem;
    max-width: 900px;
    color: var(--white);
}

.lead-text {
    font-size: clamp(1.125rem, 1.5vw, 1.5rem);
    color: var(--grey-light);
    max-width: 600px;
    margin-bottom: 4rem;
    font-weight: 400;
}

.hero-trust {
    display: flex;
    gap: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
}

.trust-item {
    display: flex;
    flex-direction: column;
}

.trust-item strong {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.trust-item span {
    font-size: 0.875rem;
    color: var(--grey-light);
}

/* Structured Form Block */
.hero-form-container {
    background: var(--white);
    padding: 3rem;
    border: 1px solid var(--grey-light);
    color: var(--black);
    scroll-margin-top: 100px;
}

.form-header {
    margin-bottom: 3rem;
}

.form-header h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.step-indicator {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue-accent);
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--grey-light);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--blue-accent);
    width: 33.33%;
    transition: width 0.4s ease;
}

.success-mark {
    width: 64px;
    height: 64px;
    background: var(--blue-accent);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes successScale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 1; }
    to { opacity: 1; }
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 0;
    border: none;
    border-bottom: 1px solid var(--grey-mid);
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    border-radius: 0;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-bottom-color: var(--black);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 1em;
    padding-right: 1.5rem !important; /* Ensure text never hits the chevron */
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-top: 3rem;
}

.privacy-note {
    font-size: 0.75rem;
    color: var(--grey-mid);
    margin-top: 1.5rem;
}

/* Structural Sections */
.structural-section {
    padding: 6vw 0;
}

.split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 1024px) {
    .split-grid {
        grid-template-columns: 4fr 8fr;
        gap: 6vw;
    }
}

@media (min-width: 1024px) {
    .split-heading {
        position: sticky;
        top: 120px;
        height: fit-content;
    }
}

.split-heading h2 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
}

.text-large p {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    color: var(--grey-dark);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Capabilities Grid */
.capabilities-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .capabilities-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
    }
}

.capability-item {
    padding-right: 2rem;
}

@media (min-width: 768px) {
    .capability-item.border-left {
        padding-left: 2rem;
    }
}

.cap-number {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 2rem;
    color: var(--grey-mid);
}

.capability-item h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.capability-item p {
    color: var(--grey-dark);
    font-size: 0.875rem;
}

/* Line List */
.line-list {
    list-style: none;
}

.line-list li {
    border-bottom: 1px solid var(--grey-light);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.line-list li:first-child {
    padding-top: 0;
}

@media (min-width: 768px) {
    .line-list li {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.line-list strong {
    font-size: 1.25rem;
    font-weight: 500;
}

.line-list span {
    color: var(--grey-mid);
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .line-list span {
        margin-top: 0;
    }
}

/* Footer */
.footer {
    padding: 6vw 0 2vw;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    margin-bottom: 6vw;
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 2fr;
    }
}

.footer-link-title {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--black);
}

.footer-nav {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 1rem;
}

.footer-nav a {
    color: var(--grey-dark);
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: var(--black);
}

.footer-desc {
    color: var(--grey-mid);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-compliance {
    font-size: 0.75rem;
    color: var(--grey-dark);
}

.footer-legal {
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
    font-size: 0.75rem;
    color: var(--grey-mid);
}

.legal-links a {
    color: var(--grey-mid);
    margin-left: 2rem;
}

/* Full-Width Brand Gallery */
.brand-gallery {
    width: 100%;
    background-color: var(--white);
    overflow: hidden;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    filter: grayscale(20%);
    transition: var(--transition);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.gallery-item:hover {
    filter: grayscale(0%);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Feature List Alignment Fix */
.feature-list {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0;
}

@media (min-width: 768px) {
    .feature-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-item:nth-child(even) {
        border-left: 1px solid var(--grey-light);
        padding-left: 2rem;
    }
    
    .feature-item:nth-child(n+3) {
        border-bottom: none;
    }
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--grey-light);
}

@media (min-width: 768px) {
    .feature-item:nth-child(odd) {
        padding-right: 2rem;
    }
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item svg {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.feature-text h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--black);
    font-weight: 500;
}

.feature-text p {
    font-size: 0.875rem;
    color: var(--grey-dark);
}

/* Directory Page Styles */
.directory-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--grey-light);
}

.directory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--grey-light);
    transition: var(--transition);
}

.directory-item span {
    font-size: 1.25rem;
    font-weight: 500;
}

.directory-item svg {
    color: var(--grey-mid);
    transition: transform 0.3s ease, color 0.3s ease;
}

.directory-item:hover {
    padding-left: 1rem;
    color: var(--blue-accent);
}

.directory-item:hover svg {
    transform: translateX(10px);
    color: var(--blue-accent);
}

/* Header Dropdown System */
.header-actions-group {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 18px); /* Precisely reaches the 80px header bottom */
    width: 280px;
    background: var(--white);
    border: 1px solid var(--grey-light);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: var(--transition);
    z-index: 1000;
}

/* Hover Bridge - ensures menu stays open while crossing the gap */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--black);
    border-bottom: 1px solid var(--grey-bg);
    transition: var(--transition);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--grey-bg);
    color: var(--blue-accent);
    padding-left: 1.75rem;
}

.dropdown-item svg {
    opacity: 1;
    transition: var(--transition);
}

.dropdown-item:hover svg {
    opacity: 1;
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .dropdown-menu {
        position: fixed;
        top: 80px !important;
        left: 0;
        right: 0;
        width: 100%;
        border-right: none;
        border-left: none;
        transform: translateY(0) !important; /* Remove jump on mobile */
        box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    }
}

/* Cinematic Video Hero */
.hero-section.video-hero {
    position: relative;
    overflow: hidden;
    background: #020a1a url('https://images.unsplash.com/photo-1518152006812-edab29b069ac?auto=format&fit=crop&q=80&w=2000') center/cover no-repeat;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0; 
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 5;
}


/* Finalized Video Hub - Fallback + Motion Layering */
.hero-section.video-hero {
    position: relative;
    overflow: hidden;
    background-color: #000;
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.3)), url('ocean-fallback.jpg');
    background-size: cover;
    background-position: center;
}

.video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.77vh;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.video-background iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(1.1);
    background: transparent !important; /* Prevent black flash */
    opacity: 1;
    animation: fadeInVideo 2s ease forwards;
    animation-delay: 2s; /* Wait for initial buffer */
}

@keyframes fadeInVideo {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
    z-index: 2;
}

.hero-section .container {
    position: relative;
    z-index: 10;
}

/* Fluid Exchange - Page Transitions */
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: pageFadeIn 0.3s ease-out forwards;
}

/* Modern View Transitions API (Chrome/Edge/Safari support) */
@view-transition {
  navigation: auto;
}

/* Fluid Sequence - Page Exit */
.page-exit {
    animation: pageFadeOut 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes pageFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}


/* Executive Speed Staggered Reveal */
.display-title, .hero-content h1 {
    opacity: 0;
    animation: luxuryFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.05s;
}

.lead-text, .hero-content p {
    opacity: 0;
    animation: luxuryFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.15s;
}

.hero-form-container, .hero-content .btn, .hero-trust, .header-actions-group {
    opacity: 0;
    animation: luxuryFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.25s;
}

.structural-section, .brand-gallery, .footer {
    opacity: 0;
    animation: luxuryFadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.4s;
}

@keyframes luxuryFadeIn {
    from {
        opacity: 0; 
        transform: translateY(15px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Fluid Sequence - Page Transitions */
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: pageFadeIn 0.3s ease-out forwards;
}

/* Modern View Transitions API */
@view-transition {
  navigation: auto;
}

/* Fluid Sequence - Page Exit */
.page-exit {
    animation: pageFadeOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes pageFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* Exit Intent Modal */
.exit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(5px);
}

.exit-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.exit-modal-content {
    background: var(--white);
    padding: 4rem 3rem;
    max-width: 550px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.exit-modal-overlay.active .exit-modal-content {
    transform: translateY(0);
}

.close-exit-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--grey-mid);
    padding: 0.5rem;
}

.exit-modal-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.875rem;
    font-weight: 300;
    color: var(--black);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.exit-modal-text {
    color: var(--grey-dark);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

@keyframes luxuryFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(15px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}
