/*
 * Akcepto v2 – formularz wniosku [alm_loan_application] (strona /kalkulator/).
 * Nadpisuje bazę z finex-loan-manager.css. Wszystko w obrębie .ak-form (szablon form/loan-application.php),
 * okna weryfikacji tworzone przez JS wtyczki – w body.ak-form-page (klasa z js/form.js).
 * JS wtyczki ustawia etykietom style inline (transform, left, font-size, color), stąd !important przy etykietach.
 */

.ak-form {
    --ak-ink: #2A1602;
    --ak-text: #4A3A28;
    --ak-muted: #6B5540;
    --ak-label: #8C7458;
    --ak-orange: #FF9F0A;
    --ak-orange-text: #C26A00;
    --ak-link: #8A4600;
    --ak-line: #F0E3D2;
    --ak-field: #E3D3BE;
    --ak-cream: #FFFBF5;
    --ak-ok: #2E8B47;
    --ak-err: #B3261E;
    max-width: none;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--ak-ink);
}

.ak-form [hidden] {
    display: none !important;
}

.ak-form *,
.ak-form *::before,
.ak-form *::after {
    box-sizing: border-box;
}

/* ===== Hero ===== */
.ak-form .ak-form-hero {
    position: relative;
    overflow: hidden;
    margin: 12px 12px 0;
    padding: 18px 20px 120px;
    border-radius: 36px;
    background: linear-gradient(135deg, #FFE7C7 0%, #FFD49E 60%, #FFB547 100%);
    scroll-margin-top: 0;
}

.ak-form .ak-form-hero::before {
    content: '';
    position: absolute;
    width: 640px;
    height: 640px;
    right: -200px;
    top: -320px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.ak-form .ak-form-hero__inner {
    position: relative;
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.ak-form .ak-form-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ak-form .ak-form-logo img {
    display: block;
    height: 48px;
    width: auto;
}

.ak-form .ak-form-secure {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ak-text);
}

.ak-form .ak-form-secure svg {
    color: var(--ak-orange);
}

.ak-form .ak-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ak-form .ak-progress__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.ak-form .ak-progress__label {
    font-weight: 600;
}

.ak-form .ak-progress__time {
    color: var(--ak-text);
}

.ak-form .ak-progress__bar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
}

.ak-form .ak-progress__seg {
    height: 6px;
    border-radius: 3px;
    background: rgba(42, 22, 2, 0.12);
    transition: background 0.3s ease;
}

.ak-form .ak-progress__seg.is-done {
    background: var(--ak-orange);
}

.ak-form .ak-form-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.ak-form .ak-form-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -1.4px;
    color: var(--ak-ink);
}

.ak-form .ak-amount {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(42, 22, 2, 0.08);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 15px;
}

.ak-form .ak-amount strong {
    font-size: 18px;
    font-weight: 700;
}

.ak-form .ak-amount #loan-amount-display,
.ak-form .ak-amount #loan-period-display {
    color: var(--ak-ink) !important;
}

.ak-form .ak-amount__edit {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ak-link);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.ak-form .ak-amount__edit:hover {
    background: transparent;
    color: #5C2F00;
}

/* ===== Układ: karta formularza + karta boczna ===== */
.ak-form .ak-form-body {
    position: relative;
    max-width: 1080px;
    margin: -84px auto 0;
    padding: 0 16px 64px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.ak-form .ak-form-card {
    flex: 999 1 560px;
    min-width: 0;
    background: #FFFFFF;
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(122, 61, 0, 0.12);
}

.ak-form .ak-form-side {
    flex: 1 1 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ak-form .ak-side-card {
    background: #FFFFFF;
    border: 1px solid var(--ak-line);
    border-radius: 22px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ak-form .ak-side-card__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--ak-ink);
}

.ak-form .ak-side-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #5A4330;
}

.ak-form .ak-side-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 20px 20px 20px 5px;
    background: #FFF1DE;
    color: var(--ak-link);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-side-card[data-for="1"] {
    gap: 16px;
}

.ak-side-card[data-for="1"] .ak-side-card__title {
    font-size: 19px;
}

.ak-form .ak-next-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ak-form .ak-next-steps li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0;
}

.ak-form .ak-next-steps li div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ak-form .ak-next-steps strong {
    font-size: 15px;
}

.ak-form .ak-next-steps li div span {
    font-size: 13px;
    color: var(--ak-muted);
}

.ak-form .ak-drop {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 16px 16px 16px 4px;
    background: #2E1702;
    color: var(--ak-orange);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-form .ak-drop.is-active {
    background: var(--ak-orange);
    color: #2E1702;
}

/* ===== Kroki ===== */
.ak-form .alm-step-content {
    padding: 0;
}

.ak-form .alm-step-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    margin: -1px !important;
    padding: 0 !important;
}

.ak-form .alm-form-row {
    gap: 18px;
    margin-bottom: 20px;
}

.ak-form .alm-form-row-address-numbers {
    gap: 18px;
    margin-bottom: 0;
}

/* Ulica na całą szerokość, numery domu i mieszkania pod nią */
.ak-form .alm-form-row:has(> .street-field) {
    flex-wrap: wrap;
}

.ak-form .alm-form-row > .street-field,
.ak-form .alm-form-row > .alm-form-row-address-numbers {
    flex: 1 1 100%;
}

.ak-form .ak-hint,
.ak-form .ak-hint--row {
    margin: 8px 0 0;
    padding-left: 2px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ak-muted);
}

.ak-form .ak-hint--row {
    margin: -8px 0 20px;
}

.ak-form .ak-optional {
    font-weight: 400;
    color: var(--ak-muted);
}

.ak-form .employer-title,
.ak-form .alm-step-5-dochody,
.ak-form .alm-step-5-wydatki,
.ak-form .ak-field-title {
    margin: 4px 0 16px !important;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--ak-ink);
}

.ak-form .employer-title,
.ak-form .alm-step-5-wydatki {
    padding-top: 22px;
    border-top: 1px solid #F3E8DA;
}

.ak-form .ak-field-title {
    margin: 0 0 10px !important;
    font-size: 15px;
}

.ak-form .ak-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #FFF6EA;
    font-size: 14px;
    color: #5A4330;
}

.ak-form .ak-info svg {
    flex: none;
    color: var(--ak-link);
}

/* ===== Pola ===== */
.ak-form .alm-input {
    height: 56px;
    padding: 0 16px !important;
    border: 1.5px solid var(--ak-field);
    border-radius: 14px !important;
    background-color: #FFFFFF;
    font-family: inherit;
    font-size: 17px;
    color: var(--ak-ink);
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ak-form .alm-input:focus {
    border-color: var(--ak-orange) !important;
    box-shadow: 0 0 0 4px rgba(255, 159, 10, 0.18);
    outline: none;
}

.ak-form .alm-input.is-valid {
    border-color: var(--ak-ok) !important;
}

.ak-form input.alm-input.is-valid:not(.alm-date-input) {
    padding-right: 48px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%232E8B47' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

/* Krok 5: sam zielony border, bez ikonki */
.ak-form .alm-form-step[data-step="5"] input.alm-input.is-valid {
    background-image: none;
}

.ak-form .alm-input.is-invalid {
    border-color: var(--ak-err) !important;
    box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.12);
}

.ak-form .alm-input::placeholder {
    color: transparent;
}

/* Etykieta wewnątrz pola, po wpisaniu przesuwa się na ramkę */
.ak-form .alm-floating-label {
    top: 28px !important;
    left: 13px !important;
    transform: translateY(-50%) !important;
    padding: 0 5px !important;
    border-radius: 6px;
    background: transparent;
    font-size: 16px !important;
    font-weight: 500;
    line-height: 1.2;
    color: var(--ak-label) !important;
    max-width: calc(100% - 70px);
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease, background 0.15s ease !important;
}

.ak-form .alm-floating-label svg {
    color: var(--ak-link);
}

.ak-form .alm-input-wrapper.has-value .alm-floating-label,
.ak-form .alm-input-wrapper.is-focused .alm-floating-label,
.ak-form .alm-input-wrapper .alm-select ~ .alm-floating-label,
.ak-form .alm-input-wrapper .ak-suffix ~ .alm-floating-label {
    top: 0 !important;
    font-size: 12.5px !important;
    font-weight: 600;
    color: var(--ak-muted) !important;
    background: #FFFFFF;
}

.ak-form .alm-input-wrapper.is-focused .alm-floating-label {
    color: var(--ak-orange-text) !important;
}

/* Pusta lista rozwijana: etykieta w środku pola (jak przy pustym polu tekstowym), na ramkę dopiero po wyborze */
.ak-form .alm-input-wrapper:not(.is-focused) .alm-select:required:invalid ~ .alm-floating-label {
    top: 28px !important;
    font-size: 16px !important;
    font-weight: 500;
    background: transparent;
}

.ak-form .alm-input-wrapper:not(.is-focused) .alm-select:required:invalid:not(.is-invalid) ~ .alm-floating-label {
    color: var(--ak-label) !important;
}

.ak-form .alm-input-wrapper .alm-input.is-invalid ~ .alm-floating-label {
    color: var(--ak-err) !important;
}

/* Komunikat walidacji pod polem */
.ak-form .alm-validation-message {
    position: static;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 0 0 4px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ak-err);
    opacity: 1;
    transform: none;
    animation: none;
}

.ak-form .alm-validation-message::before {
    content: '';
    flex: none;
    width: 15px;
    height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23B3261E' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16.5v.5'/%3E%3C/svg%3E") no-repeat center;
}

.ak-form .alm-input.is-invalid ~ .alm-validation-message {
    display: flex;
    animation: none;
}

/* Podpowiedzi (?) zastępuje opis pod polem – w projekcie nie ma ikon */
.ak-form .alm-tooltip:not(.alm-paste-icon) {
    display: none;
}

/* Telefon z prefiksem +48 */
.ak-form .phone-prefix {
    top: 28px; /* środek pola (56px), a nie wrappera – ten rośnie o komunikat błędu */
    left: 17px;
    font-size: 17px;
    color: var(--ak-ink);
}

.ak-form #phone_number:focus,
.ak-form #phone_number:not(:placeholder-shown) {
    padding-left: 54px !important;
}

/* Listy rozwijane */
.ak-form .alm-select-arrow {
    display: none;
}

.ak-form .alm-select {
    padding: 0 44px 0 16px !important;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23C26A00' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 18px !important;
    color: var(--ak-ink);
    cursor: pointer;
}

.ak-form .alm-select:required:invalid {
    color: var(--ak-label);
}

/* Daty z ikoną kalendarza */
.ak-form .alm-calendar-icon {
    left: 16px;
    top: 28px; /* środek pola (56px), a nie wrappera – ten rośnie o komunikat błędu */
}

.ak-form .alm-date-input {
    padding-left: 46px !important;
    cursor: pointer;
}

.ak-form .alm-input-wrapper:not(.has-value):not(.is-focused) .alm-date-input ~ .alm-floating-label {
    left: 40px !important;
}

/* Kwoty z dopiskiem zł / mies. */
.ak-form .ak-suffix {
    position: absolute;
    right: 16px;
    top: 28px;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--ak-muted);
    pointer-events: none;
    z-index: 2;
}

.ak-form .alm-input-wrapper:has(.ak-suffix) .alm-input {
    padding-right: 92px !important;
    background-image: none;
}

/* Osoby na utrzymaniu: − liczba + (przyciski dodaje js/form.js) */
.ak-form .ak-dependants .alm-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ak-form .ak-dependants .alm-floating-label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.ak-form .ak-dependants .alm-input {
    width: 88px;
    flex: none;
    padding: 0 8px !important;
    border-color: transparent;
    background: var(--ak-cream);
    background-image: none !important;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
}

.ak-form .ak-dependants .alm-validation-message {
    flex-basis: 100%;
}

.ak-form .ak-dependants .ak-hint {
    max-width: 220px;
}

.ak-form .ak-stepper {
    flex: none;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 1.5px solid #EADBC8;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: none;
    color: var(--ak-ink);
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.ak-form .ak-stepper:hover,
.ak-form .ak-stepper:focus {
    background: #FFF6EA;
    color: var(--ak-ink);
    border-color: var(--ak-orange);
}

/* PESEL – przypomnienie (JS pokazuje przez style.display) */
.ak-form .alm-pesel-info {
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 12px 14px;
    background: #FFF4E3;
    border: 1px solid #F6DDB8;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    color: #4A2A08;
}

.ak-form .alm-pesel-info[style*="block"] {
    display: flex !important;
}

.ak-form .ak-pesel-info__icon {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 17px 17px 17px 5px;
    background: var(--ak-orange);
    color: #2E1702;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Konto bankowe: PL + pole + wklej */
.ak-form .ak-iban {
    padding-left: 58px;
}

.ak-form .ak-iban__prefix {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--ak-field);
    border-radius: 14px;
    background: var(--ak-cream);
    font-size: 17px;
    color: var(--ak-ink);
}

.ak-form .ak-iban .alm-floating-label {
    left: 71px !important;
}

.ak-form .ak-iban .alm-input {
    padding-right: 64px !important;
    letter-spacing: 0.5px;
}

.ak-form .ak-iban .alm-input.is-valid {
    background-position: right 64px center;
    padding-right: 96px !important;
}

.ak-form .alm-paste-icon {
    right: 8px;
    top: 28px;
}

.ak-form .alm-paste-icon .alm-tooltip-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #FFF1DE;
    opacity: 1;
}

.ak-form .alm-paste-icon .alm-tooltip-icon img {
    width: 18px;
    height: 18px;
}

.ak-form .alm-bank-name {
    position: static;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 0 0 2px;
    font-size: 14px;
    font-style: normal;
    color: #3D5A40;
    opacity: 1;
    transform: none;
}

.ak-form .alm-bank-name:not(:empty) {
    display: flex;
    animation: none;
}

.ak-form .alm-bank-name:not(:empty)::before {
    content: '';
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 3px 11px 11px 11px;
    background: var(--ak-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") no-repeat center;
}

.ak-form .alm-form-field.full-width {
    width: 100%;
}

/* ===== Zgody ===== */
.ak-form .alm-consent-options {
    margin: 4px 0 22px;
    border: 1px solid var(--ak-line);
    border-radius: 18px;
    overflow: hidden;
    padding: 0 0 6px;
}

.ak-form .alm-consent-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 8px 18px;
    font-size: 13px;
    line-height: 1.5;
    border-left: 0;
    background: transparent;
}

.ak-form .alm-consent-option:not(:first-child):not(.alm-nested-consent) {
    margin-left: 0;
}

.ak-form .alm-consent-option label {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ak-ink);
    cursor: pointer;
}

.ak-form .alm-consent-option label a {
    color: var(--ak-link);
    text-decoration: underline;
}

.ak-form .alm-consent-option p {
    display: inline;
    margin: 0;
}

/* „Zaznacz wszystkie” – pierwszy wiersz ramki */
.ak-form .consent-options-step-1 > .alm-consent-option:first-child,
.ak-form .alm-consent-header-container > .alm-consent-option {
    align-items: center;
    padding: 16px 18px;
    margin-bottom: 8px;
    background: var(--ak-cream);
    border-bottom: 1px solid var(--ak-line);
}

.ak-form .consent-options-step-1 > .alm-consent-option:first-child label,
.ak-form .alm-consent-header-container > .alm-consent-option label {
    font-size: 16px;
    font-weight: 600;
}

/* Klauzula informacyjna (ostatnia, z inline margin-left) */
.ak-form .consent-options-step-1 > .alm-consent-option[style*="margin-left"] {
    margin: 6px 18px 0 !important;
    padding: 12px 0 6px;
    border-top: 1px solid #F3E8DA;
}

.ak-form .consent-options-step-1 > .alm-consent-option[style*="margin-left"] label {
    color: #5A4330;
}

.ak-form .alm-consent-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    border: 1.5px solid #CDB89C;
    border-radius: 5px !important;
    background: #FFFFFF;
}

.ak-form .consent-options-step-1 > .alm-consent-option:first-child input[type="checkbox"],
.ak-form .alm-consent-header-container > .alm-consent-option input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
}

.ak-form .alm-consent-option input[type="checkbox"]:checked {
    border-color: var(--ak-orange);
    border-radius: 5px !important;
    background: var(--ak-orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232E1702' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") no-repeat center;
}

.ak-form .alm-consent-option input[type="checkbox"]:checked::after {
    display: none;
}

.ak-form .alm-consent-option.error {
    border-left: 0;
    padding-left: 18px;
    background: rgba(179, 38, 30, 0.04);
}

.ak-form .alm-consent-option.error label {
    color: var(--ak-err);
    font-weight: 400;
}

.ak-form .alm-consent-option.error input[type="checkbox"] {
    border-color: var(--ak-err);
}

.ak-form .alm-consent-error-message {
    align-items: center;
    gap: 6px;
    margin: 4px 0 0 !important;
    padding: 8px 18px;
    font-size: 13px;
    color: var(--ak-err);
}

.ak-form .required-mark {
    color: var(--ak-err);
    margin-left: 2px;
}

.ak-form .alm-expand-text {
    margin-left: 2px;
    color: #B35C00;
    font-weight: 600;
    cursor: pointer;
}

.ak-form .alm-expanded-content {
    margin-top: 10px;
    padding: 2px 0 2px 22px;
    border-left: 2px solid var(--ak-line);
    color: #5A4330;
}

.ak-form .alm-nested-consents {
    margin-top: 10px;
}

.ak-form .alm-nested-consent {
    padding: 5px 0;
}

.ak-form .alm-nested-consent label {
    color: #3D2814;
}

/* Krok 6: nagłówek zgód + „Rozwiń wszystkie” */
.ak-form .alm-consent-header-container {
    display: block;
}

.ak-form .alm-expand-all-consents {
    text-align: left;
    padding: 4px 18px 8px;
}

.ak-form .alm-expand-all-consents a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--ak-link);
    text-decoration: none;
}

.ak-form .alm-expand-all-consents a::after {
    content: '';
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238A4600' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center;
}

.ak-form #consents-error-msg {
    color: var(--ak-err) !important;
    font-size: 13px !important;
}

.ak-form .alm-partners-consents {
    margin: 4px 18px 8px;
    padding-left: 14px;
    border-left: 2px solid var(--ak-line);
}

.ak-form .alm-partners-consents .alm-consent-option {
    padding: 6px 0;
}

.ak-form .alm-partner-consent-block {
    margin-bottom: 10px;
}

.ak-form .alm-partner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.ak-form .alm-partner-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ak-ink);
}

.ak-form .alm-partner-toggle {
    display: inline-flex;
    width: 16px;
    height: 16px;
    color: var(--ak-link);
    transition: transform 0.2s ease;
}

.ak-form .alm-partner-consent-block.is-open .alm-partner-toggle {
    transform: rotate(180deg);
}

.ak-form .alm-partner-consents {
    margin: 6px 0 0;
    padding: 4px 0 0 14px;
}

/* ===== Nawigacja ===== */
.ak-form .alm-form-navigation {
    flex-direction: row;
    flex-wrap: wrap-reverse;
    gap: 12px;
    margin-top: 4px;
}

.ak-form .alm-form-navigation .alm-next-step,
.ak-form .alm-form-navigation .alm-prev-step {
    height: 60px;
    min-width: 0;
    margin: 0;
    border-radius: 999px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.ak-form .alm-form-navigation .alm-next-step {
    flex: 3 1 260px;
    padding: 0 24px !important;
    border: 0;
    background: var(--ak-orange);
    color: #2E1702;
    font-size: 19px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(255, 159, 10, 0.32);
}

.ak-form .alm-form-navigation .alm-next-step:hover,
.ak-form .alm-form-navigation .alm-next-step:focus {
    background: #F29400;
    color: #2E1702;
}

.ak-form .alm-form-navigation .alm-next-step[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.ak-form .alm-form-navigation .alm-prev-step {
    order: -1;
    flex: 1 1 140px;
    padding: 0 20px !important;
    border: 2px solid #EADBC8;
    background: #FFFFFF;
    color: var(--ak-ink);
    font-size: 17px;
    font-weight: 600;
    box-shadow: none;
}

.ak-form .alm-form-navigation .alm-prev-step:hover,
.ak-form .alm-form-navigation .alm-prev-step:focus {
    background: #FFF6EA;
    color: var(--ak-ink);
    border-color: #E3CBAA;
}

.ak-form .ak-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--ak-muted);
    text-align: center;
}

.ak-form .ak-secure-note svg {
    width: 14px;
    height: 14px;
}

/* ===== Okno zmiany kwoty i okresu ===== */
.ak-form #loanEditModal {
    background: rgba(30, 14, 1, 0.62);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    padding: 16px;
}

.ak-form #loanEditModal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

.ak-form #loanEditModal .alm-modal-content {
    position: relative;
    width: 520px;
    max-width: 100%;
    margin: 80px auto 24px;
    padding: 32px 32px 16px;
    border-radius: 28px;
    background: #FFFFFF;
    box-shadow: 0 30px 80px rgba(122, 61, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 22px;
    text-align: left;
}

.ak-form #loanEditModal .alm-modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #FFF6EA;
    color: var(--ak-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    cursor: pointer;
}

.ak-form .ak-modal-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 44px;
}

.ak-form #loanEditModal .alm-modal-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--ak-ink);
    text-align: left;
}

.ak-form .ak-modal-head p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ak-muted);
}

.ak-form #loanEditModal .alm-modal-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.ak-form .ak-modal-label {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ak-ink);
}

.ak-form #loanEditModal .alm-modal-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    padding: 0 10px 0 20px;
    border: 2px solid #EADBC8;
    border-radius: 16px;
    background: var(--ak-cream);
}

.ak-form #loanEditModal .alm-modal-input-wrapper:focus-within {
    border-color: var(--ak-orange);
}

.ak-form #loanEditModal .alm-modal-input-wrapper .alm-input {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 0 !important;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.6px;
    color: var(--ak-ink);
    text-align: left;
}

.ak-form #loanEditModal .alm-modal-input-suffix {
    position: static;
    transform: none;
    font-size: 18px;
    font-weight: 600;
    color: var(--ak-muted);
}

.ak-form .ak-modal-pen {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #FFF1DE;
    color: var(--ak-link);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-form .ak-modal-sep {
    height: 1px;
    background: #F3E8DA;
}

/* Suwaki w oknie */
.ak-form #loanEditModal .alm-slider-container {
    margin: 4px 2px 0;
    gap: 10px;
}

.ak-form #loanEditModal .alm-custom-slider {
    height: 8px;
    margin: 10px 0 0;
    border-radius: 4px;
    background: #F0E3D2;
}

.ak-form #loanEditModal .alm-slider-progress {
    border-radius: 4px;
    background: var(--ak-orange);
}

.ak-form #loanEditModal .alm-slider-handle {
    width: 28px;
    height: 28px;
    background: #FFFFFF;
    border: 4px solid var(--ak-orange);
    box-shadow: 0 2px 8px rgba(122, 61, 0, 0.2);
}

.ak-form #loanEditModal .alm-slider-handle img {
    display: none;
}

.ak-form #loanEditModal .alm-slider-values {
    font-size: 13px;
    color: var(--ak-label);
}

.ak-form .ak-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 2px;
}

.ak-form #loanEditModal .alm-modal-button {
    width: 100%;
    height: 60px;
    margin: 0;
    padding: 0 24px !important;
    border: 0;
    border-radius: 999px;
    background: var(--ak-orange);
    color: #2E1702;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(255, 159, 10, 0.32);
    cursor: pointer;
}

.ak-form #loanEditModal .alm-modal-button:hover {
    background: #F29400;
}

.ak-form .ak-modal-cancel {
    height: 48px;
    padding: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ak-muted);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.ak-form .ak-modal-cancel:hover {
    background: transparent;
    color: var(--ak-ink);
}

/* ===== Pobieranie danych (kod pocztowy, NIP z GUS) – komunikat wtyczki zamiast podpowiedzi ===== */
.ak-form .postal-loading-message,
.ak-form .gus-loading-message {
    position: relative;
    left: auto;
    bottom: auto;
    margin: 8px 0 0;
    padding-left: 24px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ak-muted);
}

.ak-form .postal-loading-message::before,
.ak-form .gus-loading-message::before {
    width: 14px;
    height: 14px;
    border-color: var(--global-palette1, #FF9F0A);
    border-top-color: transparent;
}

/* Spinner jest w komunikacie – bez loading.gif z bazy (nie istnieje w motywie) */
.ak-form #postal_code.loading,
.ak-form #company_nip.loading {
    background-image: none;
}

.ak-form .alm-form-field:has(.alm-input.loading) > .ak-hint {
    display: none;
}

/* ===== Dane firmy (krok 4) – karta „Dane firmy pobrane”, js/company.js ===== */
.ak-form .ak-company-hidden {
    display: none !important;
}

.ak-form .ak-company {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid #F0E3D2;
    border-radius: 18px;
    background: #FFFBF5;
}

.ak-form .ak-company[hidden] {
    display: none;
}

.ak-form .ak-company__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ak-form .ak-company__ok {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1F7A35;
}

.ak-form .ak-company__edit {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #8A4600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.ak-form .ak-company__edit:hover {
    background: none;
    color: var(--ak-ink);
}

.ak-form .ak-company__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ak-form .ak-company__name {
    font-size: 17px;
    color: var(--ak-ink);
}

.ak-form .ak-company__addr {
    font-size: 15px;
    color: #5A4330;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .ak-form .alm-form-row-address-numbers {
        flex-direction: row;
    }

    /* wąskie pola numeru domu i mieszkania: etykieta mniejsza i bez rezerwy na ikonę, żeby się mieściła */
    .ak-form .alm-form-row-address-numbers .alm-floating-label {
        max-width: calc(100% - 20px);
    }

    .ak-form .alm-form-row-address-numbers .alm-input-wrapper:not(.has-value):not(.is-focused) .alm-floating-label {
        font-size: 14px !important;
    }
}

@media (max-width: 600px) {
    .ak-form .ak-form-hero {
        margin: 8px 8px 0;
        padding: 16px 20px 72px;
        border-radius: 28px;
    }

    .ak-form .ak-form-hero__inner {
        gap: 20px;
    }

    .ak-form .ak-form-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ak-form .ak-form-logo img {
        height: 54px;
    }

    .ak-form .ak-progress__meta {
        font-size: 13px;
    }

    .ak-form .ak-form-title {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .ak-form .ak-form-head {
        gap: 14px;
    }

    .ak-form .ak-form-body {
        margin-top: -44px;
        padding: 0 16px 40px;
        gap: 24px;
    }

    .ak-form .ak-form-card {
        flex-basis: 100%;
        padding: 20px;
        border-radius: 24px;
    }

    .ak-form #loanEditModal .alm-modal-content {
        margin: auto 0 0;
        padding: 28px 20px 12px;
    }

    .ak-form #loanEditModal.active {
        align-items: flex-end;
        padding: 12px;
    }

    .ak-form #loanEditModal .alm-modal-input-wrapper .alm-input {
        font-size: 28px;
    }
}
