@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

/* ==========================================================================
   IVF Sign-In — Frontend Styles
   ========================================================================== */

:root {
    --ivf-navy:        #0C1C7D;
    --ivf-navy-dark:   #07115A;
    --ivf-navy-hover:  #1a2fa0;
    --ivf-gradient:    linear-gradient(90deg, #334FFF 0%, #6F3AFF 100%);
    --ivf-blue:        #334FFF;
    --ivf-blue-light:  #F8F9FF;
    --ivf-text:        #1D1D1E;
    --ivf-text-muted:  #6F6F6F;
    --ivf-border:      #E2E6FF;
    --ivf-white:       #ffffff;
    --ivf-error-bg:    #fff1f0;
    --ivf-error-text:  #c0392b;
    --ivf-success-bg:  #f0faf5;
    --ivf-success-text:#1a7a45;
    --ivf-radius:      20px;
    --ivf-radius-sm:   10px;
    --ivf-shadow:      0 2px 4px rgba(12, 28, 125, 0.04),
                       0 8px 24px rgba(12, 28, 125, 0.08),
                       0 24px 56px rgba(12, 28, 125, 0.10);
    --ivf-transition:  0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Overlay
   ========================================================================== */

#ivf-signin-overlay {
    position: fixed;
    inset: 0;
    z-index: 999990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 14, 40, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: ivf-fade-in 0.2s ease both;
}

@keyframes ivf-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   Popup card
   ========================================================================== */

#ivf-signin-popup {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--ivf-white);
    border-radius: var(--ivf-radius);
    box-shadow: var(--ivf-shadow);
    overflow: hidden;
    font-family: 'DM Sans', system-ui, sans-serif;
    animation: ivf-pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes ivf-pop-in {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================================================
   Close button
   ========================================================================== */

#ivf-signin-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.10);
    color: #555555;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ivf-transition);
    padding: 0;
}

#ivf-signin-close:hover {
    background: rgba(0, 0, 0, 0.16);
    color: #333333;
}

/* ==========================================================================
   Popup header (all white)
   ========================================================================== */

.ivf-popup-header {
    background: #EEF0FF !important;
    padding: 36px 32px 28px;
    text-align: center;
    border-bottom: 1px solid var(--ivf-border);
}

.ivf-popup-logo {
    display: block !important;
    margin: 0 auto 20px !important;
    height: 32px !important;
    width: auto !important;
    max-width: 170px !important;
}

.ivf-popup-title {
    font-size: 19px !important;
    font-weight: 500 !important;
    color: #3C3F46 !important;
    margin: 0 0 8px !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em !important;
    padding: 0 !important;
    border: none !important;
}

.ivf-popup-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #6F6F6F;
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   Divider
   ========================================================================== */

.ivf-popup-divider {
    height: 1px;
    margin: 0 32px;
    background: #F1F1F1;
}

/* ==========================================================================
   Form body
   ========================================================================== */

#ivf-signin-form {
    padding: 24px 32px 20px;
}

.ivf-field {
    margin-bottom: 12px;
}

.ivf-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ivf-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.ivf-field input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #EBEBEB;
    border-radius: var(--ivf-radius-sm);
    font-size: 14px;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--ivf-text);
    background: var(--ivf-white);
    transition: border-color var(--ivf-transition), box-shadow var(--ivf-transition);
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}

.ivf-field input[type="email"]:focus {
    border-color: #C8D0FF;
    box-shadow: 0 0 0 3px rgba(51, 79, 255, 0.08);
}

.ivf-field input[type="email"]::placeholder {
    color: #AAAAAA;
}

/* ==========================================================================
   Primary button
   ========================================================================== */

.ivf-btn-primary {
    width: 100%;
    padding: 13px 20px;
    background: var(--ivf-gradient);
    color: var(--ivf-white);
    border: none;
    border-radius: var(--ivf-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', system-ui, sans-serif;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: opacity var(--ivf-transition), transform var(--ivf-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.ivf-btn-primary:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
}

.ivf-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    opacity: 1;
}

.ivf-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Message area
   ========================================================================== */

#ivf-message {
    padding: 11px 14px;
    border-radius: var(--ivf-radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 4px;
}

#ivf-message.ivf-error {
    background: var(--ivf-error-bg);
    color: var(--ivf-error-text);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

#ivf-message.ivf-error a {
    color: var(--ivf-error-text);
    font-weight: 600;
    text-decoration: underline;
}

#ivf-message.ivf-success {
    background: var(--ivf-success-bg);
    color: var(--ivf-success-text);
    border: 1px solid rgba(26, 122, 69, 0.2);
}

/* ==========================================================================
   Popup footer
   ========================================================================== */

.ivf-popup-footer {
    padding: 14px 32px 20px;
    text-align: center;
}

.ivf-popup-footer p {
    font-size: 12px;
    color: #6F6F6F;
    margin: 0;
    line-height: 1.8;
}

.ivf-popup-footer a {
    color: var(--ivf-blue);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--ivf-transition);
}

.ivf-popup-footer a:hover {
    opacity: 0.75;
}

/* ==========================================================================
   Page restriction blur
   Mirrors the approach in cme-login-popup for consistency.
   Applied by JS adding .ivf-restricted to <body>.
   ========================================================================== */

body.ivf-restricted #wrapper,
body.ivf-restricted #main,
body.ivf-restricted .fusion-page-title-bar,
body.ivf-restricted .post-content,
body.ivf-restricted footer,
body.ivf-restricted #footer {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    #ivf-signin-popup {
        border-radius: var(--ivf-radius-sm);
    }

    .ivf-popup-header {
        padding: 28px 20px 20px;
    }

    .ivf-popup-title {
        font-size: 17px !important;
    }

    .ivf-popup-divider {
        margin: 0 20px;
    }

    #ivf-signin-form {
        padding: 20px 20px 16px;
    }

    .ivf-popup-footer {
        padding: 12px 20px 16px;
    }
}
