/* =========================
   BASE WRAPPER
========================= */

.customWebFormWrapper {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

/* =========================
   HEADER
========================= */

.webFormHeading {
    font-size: 20px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 8px;
}

.webFormDescription {
    color: #64748B;
    font-size: 14px;
    margin-bottom: 20px;
}

/* =========================
   GRID LAYOUT
========================= */

.webFormItems {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.webFormItemsColumn {
    flex: 1 1 320px;
    min-width: 280px;
}

/* =========================
   FORM ITEM
========================= */

.webFormItem {
    margin-bottom: 16px;
}

.webFormItemCaption {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.webFormItemLabel {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

.webFormItemRequired {
    color: #2F7D6B;
}

/* =========================
   INPUTS
========================= */

.webFormItemField {
    position: relative;
}

.webFormItemField input:not([type="checkbox"]):not([type="radio"]),
.webFormItemField select,
.webFormItemField textarea {
    width: 100%;
    box-sizing: border-box;

    background: #F6F8FB;
    border: 1px solid #E2E8F0;
    border-radius: 12px;

    padding: 12px 14px;

    font-size: 14px;
    color: #0F172A;

    outline: none;
    transition: all 0.2s ease;
    font-weight: 300;
}

/* textarea */
.webFormItemField textarea {
    min-height: 120px;
    resize: vertical;
}

/* focus */
.webFormItemField input:focus,
.webFormItemField textarea:focus {
    border-color: #5A50C8;
    box-shadow: 0 0 0 3px rgba(90, 80, 200, 0.12);
    background: #FFFFFF;
}

/* =========================
   ERROR STATE (универсально)
========================= */

.webFormItemField.error input:not([type="checkbox"]):not([type="radio"]),
.webFormItemField.error textarea,
.webFormItemField.error select {
    border-color: #991B1B !important;
    background: #FFE5E5 !important;
    -box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.15) !important;
}

/* =========================
   RADIO
========================= */

.webFormItemFieldVariant {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

/* =========================
   PERSONAL INFO BLOCK
========================= */

.personalInfo {
    margin-top: 20px;
    padding: 12px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
}

.personalInfoFieldWrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    -border: 1px solid #E2E8F0;
    border-radius: 12px;
    -background: #FFFFFF;
    transition: all 0.2s ease;
}

/* hover */
.personalInfoFieldWrap:hover {
    -border-color: #D6DBF5;
}

/* focus */
.personalInfoFieldWrap:focus-within {
    -border-color: #5A50C8;
    box-shadow: 0 0 0 3px rgba(90, 80, 200, 0.12);
}

/* error */
.personalInfoFieldWrap.error {
    border: 1px solid #991B1B !important;
    background: #FFE5E5;
}

/* label */
.personalInfoFieldWrap label {
    margin: 0;
    line-height: 1.5;
    cursor: pointer;
    color: #334155;
}

/* checkbox */
.personalInfoFieldWrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    cursor: pointer;
	-webkit-appearance: auto !important;
    accent-color: #2F7D6B;
}

/* =========================
   BUTTONS
========================= */

.webFormTools {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.sendWebFormDw {
    background: #2F7D6B;
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.sendWebFormDw:hover {
    background: #276B5C;
}

.webFormTools input[type="reset"] {
    background: transparent;
    border: 1px solid #D6DBF5;
    color: #5A50C8;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
	font-size: 16px;
}

.webFormTools input[type="reset"]:hover {
    background: #EEF2FF;
}

/* =========================
   ERRORS TEXT
========================= */

.webFormItemError {
    font-size: 12px;
    color: #991B1B;
    margin-top: 4px;
    display: none;
}

.webFormItemError.visible {
    display: block;
}

/* =========================
   GLOBAL ERROR
========================= */

.webFormError {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #FFE5E5;
    color: #991B1B;
    display: none;
}

.webFormError.visible {
    display: block;
}

/* =========================
   MODAL SUCCESS
========================= */

.webFormMessage {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
    background: rgba(11, 18, 32, 0.6);
    backdrop-filter: blur(6px);
}

.webFormMessageContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.webFormMessageMiddle {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    width: 420px;
    max-width: 90%;
    text-align: center;
}

.webFormMessageHeading {
    font-size: 18px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 10px;
}

.webFormMessageDescription {
    color: #64748B;
    font-size: 14px;
    margin-bottom: 16px;
}

.webFormMessageExit {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    background: #5A50C8;
    color: #fff;
    text-decoration: none;
}

.webFormMessageExit:hover {
    background: #4B42AA;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
	.sendWebFormDw {
		box-sizing: border-box;
	}
	.webFormItemsColumn {
		flex: 1 1 20px;
	}
    .webFormItems {
        flex-direction: column;
    }

    .customWebFormWrapper {
        padding: 16px;
    }

    .webFormTools {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =========================
   SELECT ARROW
========================= */

.webFormItemField select {
    height: 52px;
    padding: 0 44px 0 16px;
    appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* =========================
   TRAP
========================= */

.webFormTrap {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* =========================
   LINKS
========================= */

.pilink {
    color: #5A50C8 !important;
}