/* ****** Portál slevy – popup „Sleva 400 Kč na fyzickou kontrolu“ na LP TipCars ******
   Markup a logika: portal-discount.php (wp_footer) + portal-discount.js.
   Rozložení podle grafického návrhu: vlevo béžový blok s nadpisem a logy portálů, vpravo nabídka a formulář;
   pod 680 px se bloky skládají pod sebe. Barvy tlačítka = Elementor globals jako v theme (afterOrder-popup.css). */

.akpdOverlay{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.55);
    font-family: "Poppins", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Jednotný font pro vše uvnitř (theme stylizuje odkazy/tlačítka jiným písmem) */
.akpdOverlay *,
.akpdOverlay a,
.akpdOverlay button,
.akpdOverlay input{
    font-family: inherit;
    box-sizing: border-box;
}

html.akpd-open,
html.akpd-open body{
    overflow: hidden;
}

#akpdOverlay .akpdBox{
    position: relative;
    display: flex !important;
    flex-direction: row;
    align-items: stretch !important;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 0;
    max-width: 860px;
    width: 100%;
    max-height: 100%;
    overflow: auto;
    box-shadow: 0px 3px 16px -2px rgba(0, 0, 0, 0.3);
    color: #1a1a1a;
    outline: none;
}

.akpdClose{
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6b6b6b;
    font-size: 30px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
}

.akpdClose:hover,
.akpdClose:focus{
    background: #f2f2f2;
    color: #1a1a1a;
    outline: none;
}

/* ---------- levý blok: nadpis + loga ---------- */
#akpdOverlay .akpdSide{
    flex: 0 0 38%;
    align-self: stretch !important;   /* levý sloupec vždy na celou výšku okna */
    height: auto !important;
    min-height: 100%;
    margin: 0 !important;
    padding: 32px 26px 28px;
    background: linear-gradient(165deg, #fff8f1 0%, #fdeadb 100%);
    border-radius: 16px 0 0 16px;
}

.akpdTitle{
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

.akpdLogos{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.akpdLogoCard{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.akpdLogo{
    display: block;
    width: auto;
    max-width: 85%;
    height: auto;
}

/* TipCars = čtvercová dlaždice #393d41 s průhledným okrajem 14 % → karta má stejnou barvu a dlaždice ji vyplní */
.akpdLogoCard-tipcars{ background: #393d41; }
.akpdLogoCard-tipcars .akpdLogo{ height: 112px; max-width: none; margin: -16px 0; }

.akpdLogoCard-sauto .akpdLogo{ height: 32px; }
.akpdLogoCard-bazos .akpdLogo{ height: 36px; }

.akpdChip{
    height: 52px;
    background: #f3ede6;
    box-shadow: none;
    color: #5c5651;
    font-size: 16px;
    font-weight: 500;
}

/* ---------- pravý blok: nabídka + formulář ---------- */
.akpdMain{
    flex: 1 1 auto;
    min-width: 0;
    padding: 34px 36px 26px;
}

.akpdIcon{
    display: block;
    margin: 0 0 10px;
    color: var(--e-global-color-313b0c2, #f05a24);
}

.akpdOffer{
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
}

.akpdOfferAmount{
    color: var(--e-global-color-313b0c2, #f05a24);
    white-space: nowrap;
}

/* Tag pod nadpisem: „Na jakékoliv auto po celé ČR“ */
.akpdTag{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px;
    padding: 6px 12px 6px 10px;
    border-radius: 999px;
    background: #e9f0fa;
    color: #11457e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.akpdTag svg{ flex: 0 0 auto; }

.akpdFlag{
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.akpdText{
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #6b6b6b;
}

/* Formulář */
.akpdForm{ margin: 0; }

.akpdHp{
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.akpdRow{
    display: flex;
    flex-direction: column;   /* e-mail a tlačítko vždy pod sebou */
    gap: 12px;
}

#akpdOverlay .akpdInput{
    display: block;
    width: 100% !important;
    height: 52px !important;
    min-height: 0 !important;
    padding: 0 16px !important;
    margin: 0 !important;
    border: 1px solid #cfcfcf !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #1a1a1a !important;
    font-family: inherit !important;
    font-size: 16px !important;   /* 16px = iOS Safari nezoomuje */
    font-weight: 400 !important;
    line-height: 50px !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

#akpdOverlay .akpdInput:focus{
    border-color: var(--e-global-color-8aefd25, #f7a21b) !important;
    box-shadow: 0 0 0 3px rgba(247, 162, 27, 0.2) !important;
    outline: none;
}

#akpdOverlay .akpdForm.is-invalid .akpdInput{
    border-color: #c0392b !important;
}

/* Tlačítko: theme/Elementor stylizují globálně button i :hover (uppercase, jiný gradient, zvětšení),
   proto ID selektor + !important – stejný vzhled v klidu i na hover/focus/active. */
#akpdOverlay .akpdBtn,
#akpdOverlay .akpdBtn:hover,
#akpdOverlay .akpdBtn:focus,
#akpdOverlay .akpdBtn:active{
    display: block !important;
    width: 100% !important;
    height: 52px !important;
    min-height: 0 !important;
    padding: 0 22px !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 52px !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    border-radius: 10px !important;
    border: none !important;
    color: #ffffff !important;
    cursor: pointer;
    white-space: nowrap;
    text-align: center !important;
    background: linear-gradient(90deg, var(--e-global-color-8aefd25, #f7a21b) 0%, var(--e-global-color-313b0c2, #f05a24) 100%) !important;
    box-shadow: 0px 3px 16px -2px rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
    transition: none !important;
    filter: none !important;
    opacity: 1 !important;
    outline: none;
}

#akpdOverlay .akpdBtn:focus-visible{ outline: 3px solid rgba(240, 90, 36, 0.35) !important; outline-offset: 2px; }

#akpdOverlay .akpdBtn[disabled]{
    opacity: 0.7 !important;
    cursor: wait;
}

#akpdOverlay .akpdConsent{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: #6b6b6b;
    cursor: pointer;
}

#akpdOverlay .akpdConsent input[type="checkbox"]{
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px !important;
    margin: 1px 0 0 !important;
    padding: 0 !important;
    -webkit-appearance: auto !important;
    appearance: auto !important;
    accent-color: var(--e-global-color-313b0c2, #f05a24);
    cursor: pointer;
}

/* Odkaz dědí písmo, velikost i barvu okolního textu (theme/Elementor dávají odkazům vlastní velikost) */
#akpdOverlay .akpdConsent a,
#akpdOverlay .akpdConsent a:visited,
#akpdOverlay .akpdConsent a:hover,
#akpdOverlay .akpdConsent a:focus{
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    text-transform: none !important;
    color: inherit !important;
    text-decoration: underline !important;
    background: none !important;
    box-shadow: none !important;
}

#akpdOverlay .akpdConsent a:hover{ color: #1a1a1a !important; }

.akpdForm.is-consent-invalid .akpdConsent{ color: #c0392b; }

.akpdError{
    min-height: 0;
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #c0392b;
}

.akpdError:empty{ display: none; }

/* Stav po odeslání */
.akpdSuccess{
    padding: 18px 16px;
    border-radius: 10px;
    background: #f3faf4;
    border: 1px solid #cfe9d3;
    text-align: center;
    outline: none;
}

.akpdSuccessTitle{
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: #1f7a3a;
}

.akpdSuccessText{
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #4a4a4a;
}

#akpdSuccessExpires{ white-space: nowrap; }

/* Blok platnosti s ikonou hodin */
.akpdValidity{
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff6ee;
    border: 1px solid #fde0c7;
    font-size: 14px;
    line-height: 1.4;
    color: #1a1a1a;
}

.akpdValidity strong{ font-weight: 700; }

.akpdValidityIcon{
    flex: 0 0 auto;
    color: var(--e-global-color-313b0c2, #f05a24);
}

/* ---------- mobil / úzká okna ---------- */
@media (max-width: 680px){
    .akpdOverlay{ padding: 12px; }

    #akpdOverlay .akpdBox{
        flex-direction: column;
        border-radius: 14px;
    }

    #akpdOverlay .akpdSide{
        flex: 0 0 auto;
        min-height: 0;
        padding: 22px 18px 18px;
        border-radius: 14px 14px 0 0;
    }

    .akpdTitle{
        margin: 0 36px 0 0;   /* místo pro křížek */
        font-size: 18px;
    }

    .akpdLogos{ display: none; }   /* na telefonu loga portálů nezobrazovat (jen nadpis) */

    .akpdMain{ padding: 22px 18px 20px; }

    .akpdIcon{ width: 40px; height: 40px; margin-bottom: 6px; }

    .akpdOffer{ font-size: 24px; }

    .akpdText{ margin-bottom: 16px; }

    .akpdTag{ white-space: normal; }

    .akpdMain{ padding-top: 20px; }

    .akpdValidity{ font-size: 13px; }
}

@media (prefers-reduced-motion: no-preference){
    .akpdBox{ animation: akpdIn 180ms ease-out; }

    @keyframes akpdIn{
        from{ opacity: 0; transform: translateY(10px); }
        to{ opacity: 1; transform: none; }
    }
}
