/*
 * Agunnaryd Flöde — anmälningspopup
 * Triggar efter 3 sek, en gång per session.
 */

body.agny-popup-open {
    overflow: hidden;
}

.agny-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.agny-popup.is-open {
    opacity: 1;
    pointer-events: auto;
}

.agny-popup[hidden] {
    display: none;
}

.agny-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.agny-popup__panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2rem 1.75rem 1.5rem;
    color: #383838;
    transform: translateY(20px);
    transition: transform 0.25s ease;
    box-sizing: border-box;
}

.agny-popup.is-open .agny-popup__panel {
    transform: translateY(0);
}

.agny-popup__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.agny-popup__close:hover,
.agny-popup__close:focus {
    background: #f3f4f6;
    color: #111;
    outline: none;
}

/* !important för att överstyra Astra/Elementor-typografi */
.agny-popup__title {
    margin: 0 0 0.6rem !important;
    padding: 0 !important;
    font-size: 1.55rem !important;
    line-height: 1.2 !important;
    color: var(--agny-primary, #0657A6) !important;
    font-weight: 700 !important;
    border: 0 !important;
}

.agny-popup__lead {
    margin: 0 0 1.2rem !important;
    color: #555 !important;
    font-size: 0.97rem !important;
    line-height: 1.5 !important;
}

.agny-popup__form {
    margin: 0;
}

.agny-popup__field {
    margin: 0 0 0.85rem !important;
    padding: 0 !important;
}

.agny-popup__field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.agny-popup__req {
    color: #b91c1c;
}

.agny-popup__field input[type="text"],
.agny-popup__field input[type="email"] {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 2px solid var(--agny-primary, #0657A6);
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    color: #111;
    box-sizing: border-box;
    transition: box-shadow 0.15s ease;
    font-family: inherit;
}

.agny-popup__field input:focus {
    box-shadow: 0 0 0 3px rgba(6, 87, 166, 0.18);
    outline: none;
}

.agny-popup__consent {
    margin: 1rem 0 1.1rem !important;
}

.agny-popup__consent label {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    cursor: pointer;
}

.agny-popup__consent input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--agny-primary, #0657A6);
}

.agny-popup__consent span {
    font-size: 0.86rem;
    color: #555;
    line-height: 1.45;
}

.agny-popup__submit {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: var(--agny-primary, #0657A6) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 6px rgba(6, 87, 166, 0.18);
    font-family: inherit;
}

.agny-popup__submit:hover:not(:disabled) {
    background: var(--agny-primary-hover, #044d8c) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 87, 166, 0.28);
}

.agny-popup__submit:disabled,
.agny-popup__submit.is-loading {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.agny-popup__small {
    margin: 0.85rem 0 0 !important;
    text-align: center;
    font-size: 0.78rem !important;
    color: #888 !important;
}

.agny-popup__notice {
    margin: 0 0 0.85rem;
    padding: 0.7rem 0.85rem;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid #fca5a5;
}

.agny-popup__success {
    text-align: center;
    padding: 0.5rem 0 1rem;
}

.agny-popup__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--agny-accent, #FFDB01);
    color: var(--agny-primary, #0657A6);
    font-size: 2rem;
    font-weight: 800;
}

.agny-popup__success h3 {
    margin: 0 0 0.5rem !important;
    color: var(--agny-primary, #0657A6) !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
}

.agny-popup__success p {
    margin: 0 !important;
    color: #555 !important;
    font-size: 0.97rem !important;
    line-height: 1.5 !important;
}

/* Honeypot — visuellt dolt men nåbart för bots */
.agny-popup__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Mobile: fyll skärmen istället för centrerad modal */
@media (max-width: 480px) {
    .agny-popup {
        padding: 0;
        align-items: stretch;
    }
    .agny-popup__panel {
        max-height: 100vh;
        max-width: none;
        height: 100vh;
        border-radius: 0;
        padding: 3.5rem 1.25rem 2rem;
    }
}
