/* Public site root is 10px (Bootstrap 3) — px only, no rem. */

.hv-tan-form {
    --tan-navy: #0e1282;
    --tan-red: #af0000;
    --tan-ink: #1a1a1a;
    --tan-mid: #5a5f6b;
    --tan-line: #b9bdc8;
    --tan-tint: #f3f4f8;
    --tan-radius: 10px;
    --tan-ring: 0 0 0 3px rgba(14, 18, 130, 0.28);
    max-width: 760px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--tan-ink);
    margin: 0 auto;
}

.hv-tan-form *,
.hv-tan-form *::before,
.hv-tan-form *::after {
    box-sizing: border-box;
}

.hv-tan-form [hidden] {
    display: none !important;
}

/* Theme styles every <button> (bg, padding, ::before overlays) — neutralize. */
.hv-tan-form button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    border: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    font: inherit;
    color: inherit;
    line-height: inherit;
    text-transform: none;
    letter-spacing: normal;
    min-width: 0;
    min-height: 0;
    height: auto;
    border-radius: 0;
    cursor: pointer;
}

.hv-tan-form button::before,
.hv-tan-form button::after {
    content: none !important;
    display: none !important;
}

.hv-tan-form button:focus {
    outline: none;
}

.hv-tan-form button:focus-visible {
    outline: none;
    box-shadow: var(--tan-ring);
}

.hv-tan-form em {
    font-style: normal;
    color: var(--tan-red);
}

/* Bootstrap 3 gives fieldset/legend/label its own spacing and weights. */
.hv-tan-form fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.hv-tan-form legend,
.hv-tan-form label {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
}

.hv-tan-form__section {
    margin-bottom: 32px !important;
}

.hv-tan-form__section > legend {
    width: 100%;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tan-navy);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tan-navy);
}

.hv-tan-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.hv-tan-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px !important;
}

.hv-tan-form__field > label,
.hv-tan-form__group > legend,
.hv-tan-form__photo-label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--tan-ink);
}

.hv-tan-form__field > label {
    margin-bottom: 0;
}

.hv-tan-form__field--short {
    max-width: 200px;
}

.hv-tan-form__sub {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--tan-mid);
}

.hv-tan-form__hint {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--tan-mid);
}

/* ── Text inputs ──────────────────────────────────────────────────────── */

.hv-tan-form input[type="text"],
.hv-tan-form input[type="email"],
.hv-tan-form input[type="number"],
.hv-tan-form textarea {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid var(--tan-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    font: inherit;
    font-size: 16px; /* ≥16px stops iOS zoom-on-focus */
    color: var(--tan-ink);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.hv-tan-form input::placeholder,
.hv-tan-form textarea::placeholder {
    color: #767b88;
    opacity: 1;
}

.hv-tan-form input[type="text"]:hover,
.hv-tan-form input[type="email"]:hover,
.hv-tan-form input[type="number"]:hover,
.hv-tan-form textarea:hover {
    border-color: #8d92a0;
}

.hv-tan-form input[type="text"]:focus,
.hv-tan-form input[type="email"]:focus,
.hv-tan-form input[type="number"]:focus,
.hv-tan-form textarea:focus {
    outline: none;
    border-color: var(--tan-navy);
    box-shadow: var(--tan-ring);
}

/* :user-invalid only kicks in after the visitor has interacted with the field. */
.hv-tan-form input:user-invalid,
.hv-tan-form textarea:user-invalid {
    border-color: var(--tan-red);
}

.hv-tan-form input:user-invalid:focus,
.hv-tan-form textarea:user-invalid:focus {
    box-shadow: 0 0 0 3px rgba(175, 0, 0, 0.22);
}

.hv-tan-form textarea {
    resize: vertical;
    min-height: 130px;
}

/* ── Pill choices (radios / checkboxes) ───────────────────────────────── */

.hv-tan-form__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hv-tan-form__choice {
    position: relative;
    display: inline-flex;
    font-weight: 400;
    cursor: pointer;
}

/* The real input covers the pill, so clicks, taps and the pointer cursor all land on it. */
.hv-tan-form__choice input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.hv-tan-form__choice span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--tan-line);
    border-radius: 999px;
    background: #fff;
    font-size: 15px;
    line-height: 1.2;
    user-select: none;
    transition:
        background-color 0.15s,
        color 0.15s,
        border-color 0.15s,
        box-shadow 0.15s;
}

.hv-tan-form__choice:hover span {
    border-color: var(--tan-navy);
    background: var(--tan-tint);
}

/* Checkmark so the selected state doesn't rely on color alone. */
.hv-tan-form__choice input:checked + span::before {
    content: "";
    width: 10px;
    height: 6px;
    margin-top: -3px;
    border: solid currentColor;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg);
}

.hv-tan-form__choice input:checked + span {
    border-color: var(--tan-navy);
    background: var(--tan-navy);
    color: #fff;
}

.hv-tan-form__choice input:focus-visible + span {
    box-shadow: var(--tan-ring);
    border-color: var(--tan-navy);
}

/* ── Deployments ──────────────────────────────────────────────────────── */

.hv-tan-form__deployments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hv-tan-form__dep {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 40px;
    gap: 8px;
    align-items: center;
}

.hv-tan-form .hv-tan-form__dep-remove {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: var(--tan-mid);
    transition:
        background-color 0.15s,
        color 0.15s;
}

.hv-tan-form .hv-tan-form__dep-remove:hover {
    background: var(--tan-tint);
    color: var(--tan-red);
}

.hv-tan-form .hv-tan-form__link {
    align-self: flex-start;
    margin-top: 10px;
    padding: 4px 2px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--tan-navy);
}

.hv-tan-form .hv-tan-form__link:hover {
    text-decoration: underline;
}

/* ── Photos ───────────────────────────────────────────────────────────── */

.hv-tan-form__photo {
    position: relative;
    display: flex;
    flex-direction: column;
    font-weight: 400;
    cursor: pointer;
}

.hv-tan-form__drop {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 2px dashed var(--tan-line);
    border-radius: var(--tan-radius);
    background: var(--tan-tint);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.hv-tan-form__photo:hover .hv-tan-form__drop {
    border-color: var(--tan-navy);
}

.hv-tan-form__photo:has(input:focus-visible) .hv-tan-form__drop {
    border-style: solid;
    border-color: var(--tan-navy);
    box-shadow: var(--tan-ring);
}

.hv-tan-form__photo:has(input:user-invalid) .hv-tan-form__drop {
    border-color: var(--tan-red);
}

.hv-tan-form__drop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv-tan-form__drop-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--tan-navy);
}

.hv-tan-form__drop.has-image .hv-tan-form__drop-text {
    display: none;
}

/* Visually hidden but still focusable and validatable. */
.hv-tan-form__photo input[type="file"] {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ── Consent, status, submit ──────────────────────────────────────────── */

.hv-tan-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px !important;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
}

.hv-tan-form__consent input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--tan-navy);
    cursor: pointer;
}

.hv-tan-form__consent input:focus-visible {
    outline: 3px solid rgba(14, 18, 130, 0.35);
    outline-offset: 2px;
}

.hv-tan-form__status {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--tan-red);
    border-radius: 6px;
    background: #fdf0f0;
    font-size: 15px;
    color: var(--tan-red);
}

.hv-tan-form__status:focus {
    outline: none;
}

.hv-tan-form .hv-tan-form__submit {
    padding: 14px 36px;
    border-radius: 999px;
    background: var(--tan-navy);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    transition:
        background-color 0.15s,
        box-shadow 0.15s;
}

.hv-tan-form .hv-tan-form__submit:hover {
    background: #0a0d5e;
}

.hv-tan-form .hv-tan-form__submit:focus-visible {
    box-shadow:
        0 0 0 3px #fff,
        0 0 0 6px var(--tan-navy);
}

.hv-tan-form .hv-tan-form__submit:disabled {
    opacity: 0.65;
    cursor: progress;
}

.hv-tan-form__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.hv-tan-form__done {
    padding: 28px;
    border-radius: var(--tan-radius);
    background: var(--tan-tint);
    text-align: center;
}

.hv-tan-form__done:focus {
    outline: none;
}

.hv-tan-form__done h3 {
    margin: 0 0 8px;
    color: var(--tan-navy);
}

.hv-tan-form__done p {
    margin: 0;
}

@media (max-width: 600px) {
    .hv-tan-form__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .hv-tan-form__row--photos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hv-tan-form * {
        transition: none !important;
    }
}
