.form {
    width: 100%;
    max-width: 420px;
}

.form p {
    display: flex;
    flex-direction: column;
    gap: 6px;

    margin: 0 0 18px;
}

.form label {
    font-size: 12px;
    font-weight: 670;
    color: var(--ink);
}

.form input,
.form textarea,
.form select {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);

    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.form select {
    min-height: 47px;
}

.form textarea {
    min-height: 96px;
    resize: vertical;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 96, 116, .1);
}

.form button:not(.photo-upload__clear) {
    width: 100%;
    min-height: 48px;

    padding: 0 21px;
    margin-top: 2px;

    border: 1px solid var(--brand);
    border-radius: var(--radius-md);

    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-button);

    font: inherit;
    font-weight: 690;
    letter-spacing: -0.01em;

    cursor: pointer;
}

.form .helptext {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
}

.form .errorlist {
    margin: 2px 0 0;
    padding: 0;

    list-style: none;

    font-size: 13px;
    line-height: 1.45;
    color: var(--danger);
}

.form .errorlist li + li {
    margin-top: 3px;
}

.photo-upload__preview {
    position: relative;
    width: fit-content;
    margin-bottom: 10px;
}

.photo-upload__preview img {
    display: block;
    width: 128px;
    height: 128px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.form .photo-upload__clear-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    opacity: 0;
}

.form .photo-upload__clear {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    background: rgba(23, 33, 43, 0.78);
    color: #fff;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.form .photo-upload__clear:hover {
    background: var(--danger);
    transform: scale(1.05);
}

.form .photo-upload__clear:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.photo-upload__picker[hidden] {
    display: none;
}

.form-field--invalid input,
.form-field--invalid textarea,
.form-field--invalid select {
    border-color: var(--danger);
    background: var(--important-soft);
}

.form-field--invalid input:focus,
.form-field--invalid textarea:focus,
.form-field--invalid select:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.form-notification {
    margin-bottom: 22px;
}

.form .form-notification .errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    color: inherit;
    font-size: inherit;
}

.form .form-notification .errorlist li + li {
    margin-top: 3px;
}

.form .form-notification .errorlist + .errorlist {
    margin-top: 3px;
}

.form button:not(.photo-upload__clear):hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.form button:not(.photo-upload__clear):disabled {
    opacity: 0.45;
    box-shadow: none;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-actions .form-button--secondary {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--brand-dark);
    box-shadow: none;
}

.form-actions .form-button--secondary:hover {
    background: var(--brand-soft);
    border-color: var(--line-strong);
}

.form button:not(.photo-upload__clear):focus-visible,
.auth__switch a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;

    margin-bottom: 18px;
}

.region-checkbox-list {
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.region-checkbox-list > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.form .region-checkbox-list label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    line-height: 1.35;
}

.form .region-checkbox-list input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    padding: 0;
    margin: 1px 0 0;
    accent-color: var(--brand);
}

.form-field--invalid .region-checkbox-list {
    border-color: var(--danger);
    background: var(--important-soft);
}

.auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 104px);
    padding: 24px 0;
}

.auth__layout {
    display: grid;
    grid-template-columns: minmax(0, 500px) minmax(240px, 320px);
    align-items: start;
    gap: 24px;
    width: 100%;
    max-width: 844px;
}

.auth__card {
    width: 100%;
    max-width: 500px;
    padding: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.auth__header {
    margin-bottom: 28px;
}

.auth__header--with-errors {
    margin-bottom: 14px;
}

.auth__header h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.5px;
}

.auth__header p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.auth__switch {
    margin: 20px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.auth__switch a {
    color: var(--brand-dark);
    font-weight: 600;
    text-decoration: none;
}

.auth__switch a:hover {
    text-decoration: underline;
}

.form p.auth__terms {
    display: block;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.form p.auth__terms a {
    color: var(--brand-dark);
    font-weight: 600;
}

.auth__forgot {
    margin: -6px 0 4px;
    text-align: right;
    font-size: 14px;
}

.auth__forgot a,
.auth__notice a {
    color: var(--brand-dark);
    font-weight: 600;
}

.auth__notice {
    margin: 0 0 18px;
    color: var(--ink-2);
    line-height: 1.5;
}

.info-box {
    width: 100%;
    padding: 24px;
    background: var(--brand-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--ink-2);
}

.info-box__title {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.35;
}

.info-box__content {
    font-size: 14px;
    line-height: 1.55;
}

.info-box__content > :first-child {
    margin-top: 0;
}

.info-box__content > :last-child {
    margin-bottom: 0;
}

.info-box__content ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.info-box__content li {
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.info-box__content li + li {
    margin-top: 0;
}

.info-box__content li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

@media (max-width: 1180px) {
    .auth__layout {
        grid-template-columns: minmax(0, 500px);
        justify-content: center;
        max-width: 500px;
    }
}

@media (max-width: 820px) {
    .auth {
        min-height: auto;
        padding: 8px 0;
    }
}

@media (max-width: 520px) {
    .auth__card {
        padding: 26px 20px;
    }

    .auth__header h1 {
        font-size: 26px;
    }

    .region-checkbox-list > div {
        grid-template-columns: 1fr;
    }
}

/* Підказки марки і моделі під полем (vehicle-catalog.js). Публічна заявка має свої правила в public-profile.css. */
.form-field {
    position: relative;
}

.form .form-field .sugg {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 232px;
    overflow-y: auto;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.form .form-field .sugg button {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 11px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    box-shadow: none;
    color: var(--ink);
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: normal;
    -webkit-tap-highlight-color: transparent;
}

.form .form-field .sugg button:hover,
.form .form-field .sugg button.hl {
    background: var(--surface-soft);
}

.form .form-field .sugg button mark {
    padding: 0;
    background: none;
    color: var(--brand);
    font-weight: 760;
}

.form .form-field .sugg .other {
    margin-top: 2px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    color: var(--brand);
    font-weight: 700;
}

/* Вибір пакета: рядки з радіокнопками замість <select> (PackageChoiceWidget). */
.form .choice-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.form .choice-list .choice {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.form .choice-list .choice:first-child {
    border-top: 0;
}

.form .choice-list .choice:has(input:checked) {
    background: var(--brand-soft);
}

.form .choice-list .choice:has(input:disabled) {
    cursor: default;
    opacity: .6;
}

.form .choice-list input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: 1.5px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: none;
}

.form .choice-list input[type="radio"]:checked {
    border: 6px solid var(--brand);
}

.form .choice-list input[type="radio"]:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.form .choice-list b {
    display: block;
    font-weight: 700;
    line-height: 1.3;
}

.form .choice-list small {
    display: block;
    margin-top: 1px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}
