/* AgroFarmHub Download Gate — стилове на формата.
   Всичко е под .afh-dl, за да не се бие с темата. Шрифтът се наследява от темата. */
.afh-dl {
    --afh-green: #2E5E3E;
    --afh-green-dark: #234A30;
    --afh-wheat: #D8B44A;
    --afh-ink: #1F2A22;
    --afh-muted: #55655A;
    --afh-line: #CFD9CC;
    --afh-field: #FFFFFF;
    --afh-soft: #F1F5EF;
    --afh-error: #B3261E;
    box-sizing: border-box;
    max-width: 680px;
    margin: 0 auto;
    padding: 28px 28px 24px;
    background: var(--afh-field);
    color: var(--afh-ink);
    border: 1px solid var(--afh-line);
    border-top: 6px solid var(--afh-green);
    border-radius: 10px;
    line-height: 1.5;
}
.afh-dl *, .afh-dl *::before, .afh-dl *::after { box-sizing: border-box; }
.afh-dl [hidden] { display: none !important; }

.afh-dl__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.afh-dl__title { margin: 0; font-size: 1.6em; line-height: 1.2; color: var(--afh-ink); }
.afh-dl__lang { display: inline-flex; border: 1px solid var(--afh-line); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.afh-dl__lang-btn {
    appearance: none; border: 0; margin: 0; background: transparent; color: var(--afh-muted);
    font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; cursor: pointer; line-height: 1.2;
    display: inline-block; text-decoration: none; box-shadow: none;
}
a.afh-dl__lang-btn:hover { color: var(--afh-green); text-decoration: none; }
.afh-dl__lang-btn[aria-pressed="true"] { background: var(--afh-green); color: #fff; }
.afh-dl__lang-btn:focus-visible { outline: 3px solid var(--afh-wheat); outline-offset: -3px; }

.afh-dl__intro { margin: 0 0 22px; color: var(--afh-muted); max-width: 60ch; }

.afh-dl__grid { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
@media (min-width: 560px) { .afh-dl__grid { grid-template-columns: 1fr 1fr; } }

.afh-dl__field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.afh-dl__field > label, .afh-dl legend { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; padding: 0; color: var(--afh-ink); }

.afh-dl input[type="text"], .afh-dl input[type="tel"], .afh-dl input[type="email"], .afh-dl select {
    width: 100%; margin: 0; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--afh-ink);
    background: var(--afh-field); border: 1px solid var(--afh-line); border-radius: 6px; box-shadow: none; height: auto;
}
.afh-dl input:focus, .afh-dl select:focus { outline: none; border-color: var(--afh-green); box-shadow: 0 0 0 3px rgba(216, 180, 74, .45); }
.afh-dl .has-error input, .afh-dl .has-error select { border-color: var(--afh-error); }
.afh-dl__err { margin: 5px 0 0; font-size: 14px; color: var(--afh-error); min-height: 0; }
.afh-dl__err:empty { display: none; }
.afh-dl__hint { margin: 5px 0 0; font-size: 13px; color: var(--afh-muted); }

/* Избор физическо лице / фирма */
.afh-dl__tiles { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .afh-dl__tiles { grid-template-columns: 1fr 1fr; } }
.afh-dl__tile { position: relative; display: block; cursor: pointer; margin: 0; }
.afh-dl__tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.afh-dl__tile-body {
    display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 12px;
    padding: 14px 16px; border: 2px solid var(--afh-line); border-radius: 8px; background: var(--afh-field);
    transition: border-color .15s, background-color .15s;
}
.afh-dl__icon { grid-row: 1 / span 2; width: 32px; height: 32px; color: var(--afh-green); align-self: center; }
.afh-dl__tile-body strong { font-size: 16px; }
.afh-dl__tile-body small { font-size: 13px; color: var(--afh-muted); line-height: 1.35; }
.afh-dl__tile:hover .afh-dl__tile-body { border-color: #9DB59F; }
.afh-dl__tile input:checked + .afh-dl__tile-body, .afh-dl__tile.is-checked .afh-dl__tile-body { border-color: var(--afh-green); background: var(--afh-soft); }
.afh-dl__tile input:focus-visible + .afh-dl__tile-body { outline: 3px solid var(--afh-wheat); outline-offset: 2px; }
.afh-dl .has-error .afh-dl__tile-body { border-color: var(--afh-error); }

.afh-dl__company { margin: 4px 0 18px; padding: 16px 16px 2px; border: 0; border-left: 4px solid var(--afh-wheat); background: var(--afh-soft); border-radius: 0 8px 8px 0; }
.afh-dl__company legend { float: left; width: 100%; margin-bottom: 12px; font-size: 16px; }
.afh-dl__company legend + * { clear: both; }

.afh-dl__check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 14px !important; cursor: pointer; }
.afh-dl__check input { margin: 3px 0 0; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--afh-green); }
.afh-dl__check a { color: var(--afh-green); }

.afh-dl__hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.afh-dl__form-err { margin: 0 0 12px; color: var(--afh-error); font-weight: 600; }
.afh-dl__form-err:empty { display: none; }

.afh-dl__submit, .afh-dl__download {
    appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; margin: 0; padding: 15px 22px; border: 0; border-radius: 8px; cursor: pointer;
    background: var(--afh-green); color: #fff; font: inherit; font-size: 17px; font-weight: 700; line-height: 1.2;
    text-transform: none; letter-spacing: normal;
}
.afh-dl__submit:hover, .afh-dl__download:hover { background: var(--afh-green-dark); color: #fff; }
.afh-dl__submit:focus-visible, .afh-dl__download:focus-visible { outline: 3px solid var(--afh-wheat); outline-offset: 3px; }
.afh-dl__submit:disabled { opacity: .75; cursor: progress; }
.afh-dl__req { margin: 12px 0 0; font-size: 13px; color: var(--afh-muted); text-align: center; }

/* Резултат */
.afh-dl__result { outline: none; }
.afh-dl__res-title { margin: 0 0 10px; font-size: 1.35em; line-height: 1.25; color: var(--afh-ink); }
.afh-dl__result p { margin: 0 0 12px; max-width: 62ch; }
.afh-dl__dl-form { margin: 20px 0 14px; }
.afh-dl__download { font-size: 24px; padding: 20px 24px; letter-spacing: 2px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); }
.afh-dl__download svg { width: 28px; height: 28px; }
.afh-dl__help { font-size: 14px; color: var(--afh-muted); }
.afh-dl__warn { padding: 10px 12px; background: #FFF4D6; border-left: 4px solid var(--afh-wheat); color: #5A4300; border-radius: 0 6px 6px 0; }
.afh-dl__result--pending_person .afh-dl__res-title::before,
.afh-dl__result--pending_company .afh-dl__res-title::before,
.afh-dl__result--inactive .afh-dl__res-title::before,
.afh-dl__result--pending_existing .afh-dl__res-title::before {
    content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; border-radius: 50%;
    background: var(--afh-wheat); vertical-align: middle;
}

@media (max-width: 480px) {
    .afh-dl { padding: 22px 16px 18px; border-radius: 8px; }
    .afh-dl__head { flex-direction: column-reverse; gap: 10px; }
    .afh-dl__title { font-size: 1.4em; }
}
@media (prefers-reduced-motion: reduce) { .afh-dl__tile-body { transition: none; } }
