/*
 * HBI-TV Toolbox | Sailthru email signup
 *
 * Styles for the front-end signup modal and the inline [hbitv_sailthru_signup] form.
 * Everything is namespaced with "hbitv-st-" so it does not collide with theme styles,
 * and the accent color comes from the tool settings as a --hbitv-st-accent variable.
 */

/* MODAL SHELL */

.hbitv-st-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hbitv-st-modal[hidden] {
    display: none;
}

.hbitv-st-modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

body.hbitv-st-modal-open {
    overflow: hidden;
}

.hbitv-st-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 32px 28px 28px;
    background-color: #ffffff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
    animation: hbitv-st-modal-in 200ms ease-out;
}

@keyframes hbitv-st-modal-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hbitv-st-modal-dialog {
        animation: none;
    }
}

.hbitv-st-modal-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: none;
    color: #666666;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.hbitv-st-modal-close:hover,
.hbitv-st-modal-close:focus {
    color: #000000;
}

.hbitv-st-modal-heading {
    margin: 0 0 10px;
    font-size: 1.5rem;
    line-height: 1.25;
    color: #111111;
}

.hbitv-st-modal-message {
    margin-bottom: 20px;
    color: #444444;
}

.hbitv-st-modal-message p:last-child {
    margin-bottom: 0;
}

/* INLINE FORM */

.hbitv-st-inline {
    max-width: 520px;
    margin: 24px 0;
    padding: 24px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    background-color: #f7f7f7;
}

.hbitv-st-inline-heading {
    margin: 0 0 10px;
    font-size: 1.35rem;
    line-height: 1.25;
}

.hbitv-st-inline-message {
    margin-bottom: 18px;
    color: #444444;
}

.hbitv-st-inline-message p:last-child {
    margin-bottom: 0;
}

/* FORM CONTROLS */

.hbitv-st-form {
    margin: 0;
}

.hbitv-st-form[hidden],
.hbitv-st-field[hidden],
.hbitv-st-confirm[hidden] {
    display: none;
}

.hbitv-st-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: left;
    color: #333333;
}

.hbitv-st-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hbitv-st-input {
    flex: 1 1 200px;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #bbbbbb;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 1rem;
    color: #111111;
}

.hbitv-st-input:focus {
    border-color: var(--hbitv-st-accent, #0b5cab);
    outline: 2px solid var(--hbitv-st-accent, #0b5cab);
    outline-offset: 1px;
}

.hbitv-st-btn {
    height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.hbitv-st-btn-primary {
    background-color: var(--hbitv-st-accent, #0b5cab);
    color: #ffffff;
}

.hbitv-st-btn-primary:hover,
.hbitv-st-btn-primary:focus {
    filter: brightness(0.9);
    color: #ffffff;
}

.hbitv-st-btn-link {
    background: none;
    color: #555555;
    text-decoration: underline;
}

.hbitv-st-btn-link:hover,
.hbitv-st-btn-link:focus {
    color: #111111;
}

.hbitv-st-btn:disabled,
.hbitv-st-input:disabled {
    opacity: 0.6;
    cursor: default;
}

/* the honeypot has to stay in the accessibility tree for bots to find it, so it is moved
   off screen rather than hidden with display: none */
.hbitv-st-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* STATUS MESSAGING */

.hbitv-st-message {
    margin: 12px 0 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.hbitv-st-message:empty {
    display: none;
}

.hbitv-st-message-error {
    color: #b3261e;
}

.hbitv-st-message-success {
    color: #1c6b32;
}

.hbitv-st-confirm {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
}

/* SMALL SCREENS */

@media (max-width: 480px) {

    .hbitv-st-modal-dialog {
        padding: 28px 18px 22px;
    }

    .hbitv-st-field-row .hbitv-st-btn,
    .hbitv-st-confirm .hbitv-st-btn {
        width: 100%;
    }

}