/*
 * ShareRing "Find out more" CTA Component
 * Version: 1.0.0
 *
 * Brand colours sourced directly from sharering.network live site (April 2026).
 *
 *   --shr-primary:      #0A0557  (dark navy, section backgrounds)
 *   --shr-accent:       #010ED0  (primary button blue, matches "Book a Demo" nav CTA)
 *   --shr-accent-hover: #010BB8  (darker blue on hover)
 *   --shr-text:         #0A0D31  (heading/dark text colour)
 *   --shr-text-light:   #64748B  (secondary/muted text)
 *   --shr-white:        #FFFFFF
 *   --shr-border:       #E2E8F0
 *   --shr-option-bg:    #F8FAFC  (option card background)
 *   Font: "Inter Tight", Inter, sans-serif
 */

/* ---------------------------------------------------------------------------
   CSS Custom Properties (design tokens)
   --------------------------------------------------------------------------- */

:root {
    --shr-primary:        #0A0557;
    --shr-accent:         #010ED0;
    --shr-accent-hover:   #010BB8;
    --shr-accent-light:   rgba(1, 14, 208, 0.08);
    --shr-text:           #0A0D31;
    --shr-text-light:     #64748B;
    --shr-white:          #FFFFFF;
    --shr-border:         #E2E8F0;
    --shr-option-bg:      #F8FAFC;
    --shr-option-hover:   #F1F5FD;
    --shr-radius-sm:      4px;
    --shr-radius-md:      8px;
    --shr-radius-lg:      12px;
    --shr-shadow:         0 20px 60px rgba(0, 0, 0, 0.18);
    --shr-transition:     0.2s ease;
    --shr-z-modal:        99999;
    --shr-font:           "Inter Tight", Inter, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------------------------------------------------------------------------
   CTA Button
   --------------------------------------------------------------------------- */

.shr-cta-wrapper {
    display: inline-block;
}

.shr-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: var(--shr-font);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--shr-white);
    background-color: var(--shr-accent);
    border: none;
    border-radius: var(--shr-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--shr-transition), transform var(--shr-transition), box-shadow var(--shr-transition);
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
}

.shr-cta-button:hover,
.shr-cta-button:focus-visible {
    background-color: var(--shr-accent-hover);
    box-shadow: 0 4px 16px rgba(91, 79, 233, 0.35);
    transform: translateY(-1px);
    outline: none;
}

.shr-cta-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.shr-cta-button:focus-visible {
    outline: 3px solid var(--shr-accent);
    outline-offset: 3px;
}

/* ---------------------------------------------------------------------------
   Modal Overlay
   --------------------------------------------------------------------------- */

.shr-cta-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--shr-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(10, 5, 87, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--shr-transition), visibility var(--shr-transition);
    /* Prevent body scroll interaction while hidden */
    pointer-events: none;
}

.shr-cta-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---------------------------------------------------------------------------
   Modal Box
   --------------------------------------------------------------------------- */

.shr-cta-modal-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--shr-white);
    border-radius: var(--shr-radius-lg);
    box-shadow: var(--shr-shadow);
    padding: 40px 36px 36px;
    font-family: var(--shr-font);
    transform: translateY(16px) scale(0.98);
    transition: transform var(--shr-transition);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.shr-cta-modal-overlay.is-open .shr-cta-modal-box {
    transform: translateY(0) scale(1);
}

/* Form modal box: slightly taller to accommodate the HubSpot form */
.shr-cta-form-box {
    max-width: 560px;
}

/* ---------------------------------------------------------------------------
   Close Button
   --------------------------------------------------------------------------- */

.shr-cta-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--shr-option-bg);
    border: 1px solid var(--shr-border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--shr-text-light);
    transition: background-color var(--shr-transition), color var(--shr-transition);
    padding: 0;
}

.shr-cta-modal-close:hover,
.shr-cta-modal-close:focus-visible {
    background-color: var(--shr-border);
    color: var(--shr-text);
    outline: none;
}

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

/* ---------------------------------------------------------------------------
   Back Button
   --------------------------------------------------------------------------- */

.shr-cta-modal-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--shr-font);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--shr-text-light);
    transition: color var(--shr-transition);
}

.shr-cta-modal-back:hover,
.shr-cta-modal-back:focus-visible {
    color: var(--shr-accent);
    outline: none;
}

.shr-cta-modal-back:focus-visible {
    outline: 3px solid var(--shr-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   Modal Header
   --------------------------------------------------------------------------- */

.shr-cta-modal-header {
    margin-bottom: 28px;
}

.shr-cta-modal-header h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shr-text);
    line-height: 1.3;
}

.shr-cta-modal-subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--shr-text-light);
    line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   Option Buttons
   --------------------------------------------------------------------------- */

.shr-cta-modal-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shr-cta-option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 18px;
    background-color: var(--shr-option-bg);
    border: 1.5px solid var(--shr-border);
    border-radius: var(--shr-radius-md);
    cursor: pointer;
    text-align: left;
    font-family: var(--shr-font);
    transition: background-color var(--shr-transition), border-color var(--shr-transition), box-shadow var(--shr-transition);
    -webkit-appearance: none;
    appearance: none;
}

.shr-cta-option-btn:hover,
.shr-cta-option-btn:focus-visible {
    background-color: var(--shr-option-hover);
    border-color: var(--shr-accent);
    box-shadow: 0 0 0 3px var(--shr-accent-light);
    outline: none;
}

.shr-cta-option-btn:focus-visible {
    outline: 3px solid var(--shr-accent);
    outline-offset: 2px;
}

.shr-cta-option-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--shr-radius-sm);
    background-color: var(--shr-accent-light);
    color: var(--shr-accent);
}

.shr-cta-option-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shr-cta-option-label strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--shr-text);
    line-height: 1.3;
}

.shr-cta-option-desc {
    font-size: 0.8125rem;
    color: var(--shr-text-light);
    line-height: 1.5;
}

.shr-cta-option-arrow {
    flex-shrink: 0;
    font-size: 1.5rem;
    color: var(--shr-text-light);
    line-height: 1;
}

/* ---------------------------------------------------------------------------
   HubSpot Form Container
   --------------------------------------------------------------------------- */

.shr-cta-hs-form-container {
    margin-top: 8px;
}

.shr-cta-form-loading {
    text-align: center;
    padding: 40px 20px;
    font-family: var(--shr-font);
    font-size: 0.9375rem;
    color: var(--shr-text-light);
}

/* Override common HubSpot form styles to match ShareRing brand */
.shr-cta-hs-form-container .hs-form fieldset {
    max-width: 100% !important;
}

.shr-cta-hs-form-container .hs-form .hs-input {
    width: 100% !important;
    padding: 10px 14px;
    border: 1.5px solid var(--shr-border) !important;
    border-radius: var(--shr-radius-sm) !important;
    font-family: var(--shr-font) !important;
    font-size: 0.9375rem !important;
    color: var(--shr-text) !important;
    background: var(--shr-white) !important;
    box-sizing: border-box !important;
    transition: border-color var(--shr-transition) !important;
}

.shr-cta-hs-form-container .hs-form .hs-input:focus {
    border-color: var(--shr-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px var(--shr-accent-light) !important;
}

.shr-cta-hs-form-container .hs-form label {
    font-family: var(--shr-font) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: var(--shr-text) !important;
    margin-bottom: 6px !important;
    display: block !important;
}

.shr-cta-hs-form-container .hs-form .hs-button {
    width: 100%;
    padding: 14px 24px !important;
    background-color: var(--shr-accent) !important;
    color: var(--shr-white) !important;
    border: none !important;
    border-radius: var(--shr-radius-sm) !important;
    font-family: var(--shr-font) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color var(--shr-transition) !important;
}

.shr-cta-hs-form-container .hs-form .hs-button:hover {
    background-color: var(--shr-accent-hover) !important;
}

.shr-cta-hs-form-container .hs-form .hs-error-msgs {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.shr-cta-hs-form-container .hs-form .hs-error-msgs li {
    font-size: 0.8125rem;
    color: #DC2626;
}

/* ---------------------------------------------------------------------------
   Body Lock (prevent scroll when modal is open)
   --------------------------------------------------------------------------- */

body.shr-cta-modal-open {
    overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Responsive: Mobile (up to 600px)
   --------------------------------------------------------------------------- */

@media (max-width: 600px) {

    .shr-cta-modal-box {
        padding: 32px 20px 28px;
        border-radius: var(--shr-radius-md);
    }

    .shr-cta-modal-header h2 {
        font-size: 1.25rem;
    }

    .shr-cta-option-btn {
        padding: 16px 14px;
        gap: 12px;
    }

    .shr-cta-option-icon {
        width: 38px;
        height: 38px;
    }

    .shr-cta-option-label strong {
        font-size: 0.9375rem;
    }
}

/* ---------------------------------------------------------------------------
   Reduced Motion
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .shr-cta-modal-overlay,
    .shr-cta-modal-box,
    .shr-cta-button,
    .shr-cta-option-btn,
    .shr-cta-modal-close {
        transition: none !important;
    }
}
