/* Everydae Brand Styles */

:root {
    --bg-cream: #F6F4F1;
    --text-charcoal: #2A2A2A;
    --accent-slate: #3F556B;
    --gray-secondary: #BFC5C9;
    --max-width: 1040px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-charcoal);
    background-color: var(--bg-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    background-color: var(--bg-cream);
    border-bottom: 1px solid var(--gray-secondary);
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(246, 244, 241, 0.95);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-charcoal);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.nav-logo:hover {
    opacity: 0.7;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-slate);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.7;
}

.nav-link:focus {
    outline: 2px solid var(--accent-slate);
    outline-offset: 2px;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    padding: 6rem 0 8rem;
    text-align: left;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-charcoal);
}

.hero-subheader {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 2.5rem;
    color: var(--text-charcoal);
    max-width: 700px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-divider {
    border-top: 1px solid var(--gray-secondary);
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--text-charcoal);
}

.section-body {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-charcoal);
    max-width: 700px;
}

/* Moment Features */
.moment-features {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.moment-features li {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--accent-slate);
    position: relative;
    padding-left: 1.5rem;
}

.moment-features li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-slate);
    font-size: 1.5rem;
    line-height: 1;
}

.receipt-line {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background-color: rgba(63, 85, 107, 0.08);
    border: 1px solid var(--gray-secondary);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
    color: var(--accent-slate);
    font-weight: 500;
    max-width: 600px;
}

.moment-cta {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Pricing */
.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.pricing-card {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--gray-secondary);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    /* iOS Safari touch improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
    display: block;
    text-decoration: none;
    color: inherit;
}

.pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pricing-amount {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-slate);
    margin-bottom: 0.75rem;
}

.pricing-period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-charcoal);
}

.pricing-description {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-charcoal);
    line-height: 1.5;
}

.pricing-fineprint {
    font-size: 0.875rem;
    color: var(--text-charcoal);
    opacity: 0.7;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Partner Page */
.hero-section {
    padding: 6rem 0 2rem 0;
}

.page-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2rem;
    color: var(--text-charcoal);
}

.partner-cta {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-slate);
    color: var(--bg-cream);
}

.btn-primary:hover {
    background-color: #2d3f52;
    transform: translateY(-1px);
}

.btn-primary:focus {
    outline: 2px solid var(--accent-slate);
    outline-offset: 2px;
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-slate);
    border: 1.5px solid var(--accent-slate);
}

.btn-secondary:hover {
    background-color: rgba(63, 85, 107, 0.05);
    transform: translateY(-1px);
}

.btn-secondary:focus {
    outline: 2px solid var(--accent-slate);
    outline-offset: 2px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--gray-secondary);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-brand {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-charcoal);
    margin-bottom: 1.5rem;
}

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

.footer-links a {
    font-size: 0.9375rem;
    color: var(--accent-slate);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.7;
}

.footer-links a:focus {
    outline: 2px solid var(--accent-slate);
    outline-offset: 2px;
    border-radius: 4px;
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--text-charcoal);
    opacity: 0.6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    /* Prevent iOS Safari address bar from affecting viewport */
    height: 100vh;
    height: -webkit-fill-available; /* iOS Safari fix */
}

.modal.active {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 0;
    /* Above carousel modal (z-index 2000) so interest/signup appear on top when opened from carousel */
    z-index: 2100;
    /* Ensure modal is always visible on iOS */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Ensure modal is interactive */
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 42, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); /* iOS Safari support */
    /* Ensure overlay covers entire viewport on iOS */
    height: 100vh;
    height: -webkit-fill-available; /* iOS Safari fix */
    /* Prevent touch events from passing through */
    touch-action: none;
    z-index: 1000;
    /* Ensure overlay is interactive */
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.modal-container {
    position: relative;
    background-color: var(--bg-cream);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 6rem);
    max-height: calc(-webkit-fill-available - 6rem); /* iOS Safari fix */
    margin: 2rem auto;
    padding: 2.5rem;
    padding-bottom: 2rem !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    overflow-y: auto;
    overflow-x: visible;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    /* Ensure container is interactive */
    pointer-events: auto;
    position: relative;
    /* Prevent container from blocking touches */
    -webkit-tap-highlight-color: transparent;
    /* Prevent scroll when clicking close button */
    overscroll-behavior: contain;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-charcoal);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    opacity: 0.7;
    z-index: 1003;
    /* iOS Safari touch improvements */
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    -webkit-appearance: none;
    appearance: none;
    /* Ensure button is clickable */
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.modal-close:hover {
    opacity: 1;
}

.modal-close:focus {
    outline: 2px solid var(--accent-slate);
    outline-offset: 2px;
    border-radius: 4px;
}

.modal-header {
    margin-bottom: 2rem;
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.modal-header .form-group {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-header .form-group label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-charcoal);
}

.modal-header .form-group input {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--gray-secondary);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--text-charcoal);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.modal-header .form-group input:focus {
    outline: none;
    border-color: var(--accent-slate);
    box-shadow: 0 0 0 3px rgba(63, 85, 107, 0.1);
}

.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-charcoal);
    line-height: 1.5;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--accent-slate);
    vertical-align: middle;
    align-self: center;
}

.checkbox-label span {
    flex: 1;
    font-weight: normal !important;
    line-height: 1.5;
    vertical-align: middle;
    align-self: center;
}

.modal-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-charcoal);
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 1rem;
    color: var(--text-charcoal);
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.modal-subtitle #selectedPlan {
    font-weight: 500;
    color: var(--accent-slate);
}

.cancel-text {
    font-size: 0.875rem;
    color: var(--text-charcoal);
    opacity: 0.6;
    margin-bottom: 1rem;
}

.fee-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-secondary);
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.fee-item {
    font-size: 0.9375rem;
    color: var(--text-charcoal);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.fee-item:last-child {
    margin-bottom: 0;
}

.fee-item span {
    font-weight: 600;
    color: var(--accent-slate);
}

.fee-item-moments {
    font-weight: 600;
    color: var(--accent-slate);
    font-size: 1rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fee-item-moments span:first-child {
    font-weight: 700;
    font-size: 1.125rem;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: rgba(63, 85, 107, 0.1);
    color: var(--accent-slate);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    position: relative;
    flex-shrink: 0;
    font-style: normal;
    line-height: 1;
}

.info-icon {
    position: relative;
}

.info-icon:hover::after {
    content: attr(data-tooltip);
    position: fixed;
    left: var(--tooltip-left, 50%);
    top: var(--tooltip-top, auto);
    bottom: auto;
    transform: translateX(-50%);
    background-color: var(--text-charcoal);
    color: var(--bg-cream);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 400;
    white-space: normal;
    width: var(--tooltip-width, 220px);
    max-width: calc(100vw - 2rem);
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
    pointer-events: none;
}

.info-icon:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-charcoal);
    z-index: 10001;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    padding-bottom: 2rem !important;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
}

.modal-form .form-group {
    margin-bottom: 0 !important;
}

.modal-form .form-group > label:not(.checkbox-label) {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-charcoal);
    margin: 0 !important;
    padding: 0;
}

.modal-form .form-group .checkbox-label {
    margin: 0 !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.modal-form .form-group:has(.checkbox-label) {
    margin-bottom: 0 !important;
    gap: 0.5rem;
}

.form-group input {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--gray-secondary);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--text-charcoal);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-slate);
    box-shadow: 0 0 0 3px rgba(63, 85, 107, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-secondary);
    opacity: 0.7;
}

.form-group select {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--gray-secondary);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--text-charcoal);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    appearance: auto;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--accent-slate);
    box-shadow: 0 0 0 3px rgba(63, 85, 107, 0.1);
}

.form-group textarea {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--gray-secondary);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--text-charcoal);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    min-height: 6rem;
    resize: vertical;
    line-height: 1.5;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-slate);
    box-shadow: 0 0 0 3px rgba(63, 85, 107, 0.1);
}

.form-group textarea::placeholder {
    color: var(--gray-secondary);
    opacity: 0.7;
}

/* Stripe Elements styling */
#card-element {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--gray-secondary);
    border-radius: 12px;
    background-color: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin: 0 !important;
    width: 100%;
    min-height: auto;
}

/* Override Stripe iframe styles */
#card-element iframe {
    margin: 0 !important;
    padding: 0 !important;
}

#card-element:focus-within {
    border-color: var(--accent-slate);
    box-shadow: 0 0 0 3px rgba(63, 85, 107, 0.1);
}

/* Specific spacing for card element form group */
.modal-form .form-group:has(#card-element),
.modal-form .form-group #card-element {
    gap: 0.5rem;
    margin: 0 !important;
}

#card-errors {
    color: #fa755a;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    display: none;
}

#card-errors:not(:empty) {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row .form-group {
    width: 100%;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.interest-modal-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
    width: 100%;
}

.interest-modal-buttons .btn {
    flex: 1;
    min-width: 0;
    width: 100%;
    text-align: center;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero {
        padding: 4rem 0 6rem;
    }

    .section {
        padding: 3.5rem 0;
    }

    .pricing-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-cta,
    .partner-cta,
    .moment-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .moment-features {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .coming-soon-text {
        font-size: 2rem;
        padding: 1.5rem;
    }

    .map-container {
        height: 400px;
    }

    #merchants-map {
        min-height: 400px;
    }

    .modal-title {
        font-size: 1.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0 4rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .modal-container:not(.carousel-modal-container) {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
        max-height: calc(100vh - 3rem);
        max-height: calc(-webkit-fill-available - 3rem); /* iOS Safari fix */
    }
    
    .modal.active:not(#momentsCarouselModal.active) {
        padding: 0.5rem 0 2.5rem 0;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 1.75rem;
    }
}

/* Map Styles */
.section-map {
    padding-top: 0;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    background-color: var(--bg-cream);
    border: 1px solid var(--gray-secondary);
    border-radius: 16px;
    overflow: hidden;
    height: 600px;
    z-index: 1;
}

#merchants-map {
    width: 100%;
    height: 100%;
    min-height: 600px;
    opacity: 0.85;
    filter: grayscale(10%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(246, 244, 241, 0.3);
    z-index: 10;
    pointer-events: none;
}

.coming-soon-text {
    font-size: 3rem;
    font-weight: 400;
    color: #3F556B;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Custom marker styling */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Leaflet popup styling to match branding */
.leaflet-popup-content-wrapper {
    background-color: var(--bg-cream);
    border: 1px solid var(--gray-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-tip {
    background-color: var(--bg-cream);
    border: 1px solid var(--gray-secondary);
}

/* Authentication Styles */
.auth-container {
    max-width: 440px;
    margin: 4rem auto;
    padding: 3rem;
    background: white;
    border: 1px solid var(--gray-secondary);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-charcoal);
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--gray-secondary);
    margin-bottom: 2rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-charcoal);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--gray-secondary);
    border-radius: 8px;
    background: white;
    color: var(--text-charcoal);
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-slate);
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-secondary);
    margin-top: 0.25rem;
}

.auth-links {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-charcoal);
}

.auth-links a {
    color: var(--accent-slate);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-links p {
    margin: 0.5rem 0;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-secondary);
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-charcoal);
}

.dashboard-subtitle {
    font-size: 1rem;
    color: var(--gray-secondary);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: white;
    border: 1px solid var(--gray-secondary);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.card-content {
    flex: 1;
}

.card-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-charcoal);
    margin-bottom: 0.25rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--gray-secondary);
}

.dashboard-section {
    margin-bottom: 3rem;
}

.dashboard-section .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-charcoal);
}

/* Moments List */
.moments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.moment-item {
    background: white;
    border: 1px solid var(--gray-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.moment-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.moment-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.moment-details {
    flex: 1;
}

.moment-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-charcoal);
    margin-bottom: 0.25rem;
}

.moment-description {
    font-size: 0.875rem;
    color: var(--text-charcoal);
    margin-bottom: 0.25rem;
}

.moment-date {
    font-size: 0.75rem;
    color: var(--gray-secondary);
}

.moment-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Payments List */
.payments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-item {
    background: white;
    border: 1px solid var(--gray-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.5rem;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.payment-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.payment-details {
    min-width: 0;
}

.payment-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-charcoal);
    margin-bottom: 0.25rem;
}

.payment-date {
    font-size: 0.875rem;
    color: var(--text-charcoal);
    margin-bottom: 0.125rem;
}

.payment-paid {
    font-size: 0.75rem;
    color: var(--gray-secondary);
}

.payment-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: right;
}

.breakdown-item {
    font-size: 0.875rem;
}

.breakdown-label {
    color: var(--gray-secondary);
    margin-right: 0.5rem;
}

.breakdown-value {
    color: var(--text-charcoal);
    font-weight: 500;
}

.payment-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Status Badges */
.status-active,
.status-credited,
.status-succeeded {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled,
.status-failed,
.status-used {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-past_due {
    background-color: #ffeaa7;
    color: #6c5ce7;
}

/* Empty State */
.empty-state {
    background: white;
    border: 1px solid var(--gray-secondary);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    color: var(--gray-secondary);
}

/* Carousel Slide Styles – single card only, no faded sides */
.carousel-slide {
    display: none;
    flex: 0 0 auto;
    width: 480px;
    max-width: 100%;
}

.carousel-slide.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.moment-card {
    text-align: left;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: auto;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    padding: 0 !important;
}

.moment-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--gray-secondary);
    position: relative;
}

.moment-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moment-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-charcoal);
    opacity: 0.3;
    font-size: 1rem;
}

.moment-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.moment-header {
    margin-bottom: 1rem;
}

.moment-amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-slate);
    margin-bottom: 0.5rem;
}

.moment-location {
    font-size: 0.95rem;
    color: var(--text-charcoal);
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.moment-instagram {
    font-size: 0.85rem;
    color: var(--accent-slate);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    display: inline-block;
    margin-bottom: 1rem;
}

.moment-instagram:hover {
    opacity: 1;
    text-decoration: underline;
}

.moment-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-charcoal);
    margin-bottom: 1.5rem;
    flex: 1;
}

.moment-action-container {
    margin-top: auto;
    padding-top: 1rem;
}

.moment-action-btn {
    width: 100%;
    margin-top: 0;
}

.carousel-btn {
    background: none;
    border: 1.5px solid var(--gray-secondary);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    color: var(--accent-slate);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.carousel-btn:hover:not(:disabled) {
    background-color: rgba(63, 85, 107, 0.05);
    border-color: var(--accent-slate);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex: 1;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background-color: var(--gray-secondary);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease;
}

.carousel-dot.active {
    background-color: var(--accent-slate);
}

.carousel-footer .btn {
    width: 100%;
}

.carousel-modal .carousel-footer {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
}

.carousel-modal .carousel-footer .btn,
.carousel-modal .carousel-footer .carousel-footer-partner {
    flex: 1;
    min-width: 0;
    width: auto;
    text-align: center;
}

/* Interest Modal Styles */
.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-slate);
    margin-bottom: 1rem;
}

.modal-subtitle {
    font-size: 1rem;
    color: var(--text-charcoal);
    line-height: 1.6;
    opacity: 0.8;
}

.modal-form {
    width: 100%;
}

.modal-form .form-group {
    margin-bottom: 1.5rem;
}

.modal-form label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-charcoal);
    margin-bottom: 0.5rem;
}

.modal-form input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1.5px solid var(--gray-secondary);
    border-radius: 8px;
    background: white;
    color: var(--text-charcoal);
    transition: border-color 0.2s ease;
}

.modal-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-slate);
}

.btn-full {
    width: 100%;
}

/* Responsive Carousel – mobile (overrides in carousel section come later so they win) */
@media (max-width: 768px) {
    .carousel-slide,
    .carousel-slide.active {
        width: min(100%, calc(100vw - 2rem));
    }
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .payment-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .payment-breakdown {
        text-align: left;
    }

    .auth-container {
        margin: 2rem auto;
        padding: 2rem 1.5rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-end;
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 1.75rem;
    }

    .moment-item,
    .payment-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .moment-status,
    .payment-status {
        align-self: flex-start;
    }
}

/* ===========================
   CAROUSEL MODAL (ISOLATED)
   =========================== */

.carousel-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    background: rgba(42, 42, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
}

.carousel-modal.active {
    display: flex;
}

.carousel-shell {
    width: 95%;
    max-width: 1100px;
    height: calc(100vh - 2rem);
    max-height: calc(100vh - 2rem);
    background: var(--bg-cream);
    border-radius: 20px;
    padding: 1rem 1.5rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    position: relative;
    flex: 0 0 auto;
    margin: auto;
}

.carousel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-charcoal);
}

.carousel-track-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 1.5rem;
    flex: 1 1 0;
    min-height: 0;
}

.carousel-placeholder {
    flex: 0 0 auto;
    width: 220px;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.carousel-placeholder:empty {
    background: var(--gray-secondary);
    border-radius: 16px;
    min-height: 120px;
    opacity: 0.4;
}

.carousel-placeholder .carousel-slide-adjacent {
    display: flex !important;
    width: 100%;
    opacity: 0.5;
    transform: scale(0.9);
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
}

.carousel-placeholder .moment-content,
.carousel-placeholder .moment-description {
    overflow: hidden;
}

.carousel-modal .carousel-track {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    flex: 1 1 0;
    min-height: 0;
}

.carousel-modal .carousel-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

.carousel-modal .carousel-footer {
    border-top: 1px solid var(--gray-secondary);
    padding: 0.75rem 0 0.75rem 0;
    margin: 0;
    text-align: center;
    flex: 0 0 auto;
}

/* Responsive card sizing: shrink to fit viewport so footer button is always visible (no modal scroll) */
.carousel-modal .carousel-slide.active {
    flex: 1;
    min-height: 0;
    max-width: 480px;
    width: 100%;
}
.carousel-modal .moment-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.carousel-modal .moment-header {
    text-align: center;
}
.carousel-modal .moment-image-container {
    height: min(200px, 22vh);
    flex-shrink: 0;
}
.carousel-modal .moment-content {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}
.carousel-modal .moment-description {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

/* Mobile carousel overrides – must come after base carousel rules to take effect */
@media (max-width: 768px) {
    .carousel-modal .carousel-track-wrapper {
        margin-top: 0.75rem;
        gap: 0.25rem;
    }
    .carousel-modal .carousel-placeholder {
        width: 36px;
    }
    /* Keep modal inside visible viewport on Pixel/Android (100vh can overcount when chrome visible) */
    .carousel-modal .carousel-shell {
        height: calc(100vh - 3rem);
        height: calc(100dvh - 3rem);
        max-height: calc(100vh - 3rem);
        max-height: calc(100dvh - 3rem);
        padding: 0.5rem 0.5rem 0 0.5rem;
        overflow-y: auto;
    }
    #momentsCarouselModal.carousel-modal {
        padding: 0.25rem 0;
        align-items: flex-start;
    }
    .carousel-modal .carousel-footer {
        padding: 0.5rem 0 0.5rem 0;
    }
    .carousel-modal .carousel-footer .btn,
    .carousel-modal .carousel-footer .carousel-footer-partner {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    .carousel-modal .moment-image-container {
        height: min(125px, 20vh);
    }
}

/* Pilot page */
#overview, #what-you-get, #how-it-works, #funding, #timeline, #apply {
    scroll-margin-top: 5rem;
}

.pilot-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-secondary);
}

.pilot-nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--accent-slate);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.pilot-nav-link:hover {
    opacity: 0.7;
}

.pilot-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.pilot-step {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.pilot-step-num {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-slate);
    color: var(--bg-cream);
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 50%;
}

/* What You Get — benefits grid */
.pilot-benefits {
    margin-bottom: 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 1.5rem;
}

.benefit-card {
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--gray-secondary);
    border-radius: 16px;
    padding: 2rem;
}

.benefit-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-slate);
    margin-bottom: 0.75rem;
}

/* What Your Customers See — materials preview */
.pilot-materials {
    margin-top: 4rem;
}

.pilot-materials-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-charcoal);
}

.pilot-materials-intro {
    font-size: 1rem;
    color: var(--text-charcoal);
    opacity: 0.85;
    margin-bottom: 1.5rem;
    max-width: 560px;
}

.materials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.material-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.material-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-secondary);
}

.material-caption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-charcoal);
    opacity: 0.75;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .materials-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

