/* Email Capture Component Styles - Walmart Business */

/* Variables */
:root {
    --ec-font-stack: EverydaySans, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --ec-color-brand-primary: #0053E2;
    --ec-color-brand-paper: #FFF;
    --ec-color-brand-text: #2E2F32;
    --ec-color-brand-text-subtle: #2E2F32;
    --ec-color-brand-background: #E4F0FC;
    --ec-color-button-primary-hover: #002E99;
    --ec-color-button-close-hover: rgba(255, 255, 255, 0.80);
    --ec-color-input-border: #909196;
    --ec-color-brand-input-text: #2E2F32;
    --ec-color-placeholder-text: #74767C;
    --ec-color-error: #CC191F;
    --ec-color-success: #0D7722;
    --ec-color-focus: #002E99;
}

/* Reset - scoped to emailcapture */
#emailcapture * {
    background: transparent;
    box-sizing: border-box;
    color: inherit;
    font-family: var(--ec-font-stack);
    font-size: 16px;
    margin: 0;
    outline: 0;
    padding: 0;
    vertical-align: baseline;
}

/* Wrapper Styles */
#emailcapture.email-capture-outer {
    background-color: var(--ec-color-brand-background);
    color: var(--ec-color-brand-text);
    font-family: var(--ec-font-stack);
    line-height: 1.4;
    overflow: hidden;
    position: fixed;
    bottom: 0;
    left: 0;
    text-align: initial;
    z-index: 9999;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#emailcapture .email-capture-wrapper {
    position: relative;
    display: flex;
    padding: 36px 44px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1150px;
}

/* Inner Body Styles */
#emailcapture .email-capture-inner {
    display: flex;
    max-width: 540px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    flex: 1 0 0;
}

@media (min-width: 834px) {
    #emailcapture .email-capture-inner {
        max-width: 640px;
    }
}

@media (min-width: 1120px) {
    #emailcapture .email-capture-inner {
        max-width: 940px;
    }
}

#emailcapture .main-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    align-self: stretch;
}

@media (min-width: 1120px) {
    #emailcapture .main-content-wrapper {
        flex-direction: row;
    }
}

#emailcapture .body-heading-wrapper {
    display: flex;
    padding-right: 8px;
    align-items: flex-start;
    align-self: stretch;
    flex: 1 0 0;
}

#emailcapture .body-heading {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

@media (min-width: 834px) {
    #emailcapture .body-heading {
        font-size: 22px;
    }
}

@media (min-width: 1120px) {
    #emailcapture .body-heading {
        font-size: 23px;
    }
}

#emailcapture p {
    font-size: 14px;
}

/* Success Message */
#emailcapture .success-message-wrapper {
    display: flex;
    padding: 8px 16px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 4px;
    align-self: stretch;
    border-left: 3px solid var(--ec-color-success);
    flex: 1 0 0;
}

#emailcapture .success-message-heading {
    align-self: stretch;
    color: var(--ec-color-success);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

#emailcapture .success-message-sub {
    align-self: stretch;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}

/* Form */
#emailcapture .form-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    align-self: stretch;
    flex: 1 0 0;
}

#emailcapture .form-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    align-self: stretch;
}

@media (min-width: 834px) {
    #emailcapture .form-wrapper {
        flex-direction: row;
    }
}

#emailcapture .input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    align-self: stretch;
    flex: 1 0 0;
}

#emailcapture .error-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    align-self: stretch;
}

#emailcapture .error-icon {
    width: 20px;
    height: 20px;
    aspect-ratio: 1/1;
}

#emailcapture .error-message {
    color: var(--ec-color-error);
    font-size: 14px;
    line-height: 22px;
    font-weight: 700;
    flex: 1 0 0;
}

#emailcapture .email-input {
    display: flex;
    padding: 8px 16px;
    align-items: center;
    align-self: stretch;
    border: none;
    border-radius: 4px;
    background: var(--ec-color-brand-paper);
    box-shadow: 0 0 0 1px var(--ec-color-input-border) inset;
    line-height: 1.5;
    color: var(--ec-color-brand-input-text);
    flex: 1 0 0;
    min-height: 40px;
    transition: none;
}

#emailcapture .email-input::placeholder {
    color: var(--ec-color-placeholder-text);
}

#emailcapture .email-input:focus,
#emailcapture .email-input:focus-visible {
    outline-style: solid !important;
    outline-color: var(--ec-color-focus) !important;
    outline-width: .25rem !important;
    outline-offset: .1rem !important;
}

#emailcapture .email-input.error {
    box-shadow: 0 0 0 3px var(--ec-color-error) inset;
}

/* Buttons */
#emailcapture .button {
    display: inline-block;
    white-space: nowrap;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    text-align: center;
    border: none;
    background-color: transparent;
    padding: 12px 16px;
    box-sizing: border-box;
    border-radius: 1000px;
    touch-action: manipulation;
    cursor: pointer;
    background-image: none;
    user-select: none;
    box-shadow: none;
    transition: none;
}

#emailcapture .button:focus,
#emailcapture .button:active:focus,
#emailcapture .button:hover:focus {
    outline-style: solid !important;
    outline-color: var(--ec-color-focus) !important;
    outline-width: .25rem !important;
    outline-offset: .1rem !important;
}

#emailcapture .button-primary {
    background-color: var(--ec-color-brand-primary);
    color: var(--ec-color-brand-paper);
}

#emailcapture .button-primary:hover {
    background-color: var(--ec-color-button-primary-hover);
}

#emailcapture .button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#emailcapture .button-sign-up {
    width: 100%;
}

@media (min-width: 834px) {
    #emailcapture .button-sign-up {
        max-width: 150px;
    }
}

#emailcapture .button-close {
    display: flex;
    padding: 8px;
    justify-content: center;
    align-items: center;
    border-radius: 36px;
    position: absolute;
    right: 8px;
    top: 8px;
    background-color: var(--ec-color-brand-background);
}

#emailcapture .button-close:hover {
    background-color: var(--ec-color-button-close-hover);
}

#emailcapture .close-x {
    width: 20px;
    height: 20px;
}

#emailcapture .text-subtle {
    color: var(--ec-color-brand-text-subtle);
}

/* Loading state */
#emailcapture .button-sign-up.loading {
    position: relative;
    color: transparent;
}

#emailcapture .button-sign-up.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid var(--ec-color-brand-paper);
    border-radius: 50%;
    border-top-color: transparent;
    animation: ec-spin 0.8s linear infinite;
}

@keyframes ec-spin {
    to {
        transform: rotate(360deg);
    }
}
