.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-container {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    position: relative;
    width: auto;
    background-color: white;
    border-radius: 1em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.modal-container h2 {
    font-size: 1.5em;
    font-weight: 700;
    text-align: center;
    color: var(--gray-dark);
}

.modal-form {
    width: 24em;
    padding: 1.5em;
}

.modal-form h2 {
    margin-bottom: 1em;
}

.form-footer {
    margin-top: 1em;
    display: flex;
    align-items: center;
    column-gap: 14px;
    justify-content: center;
}

.form-footer a:hover {
    color: #1d4ed8;
}

.form-footer a:first-child {
    justify-self: end;
}

.form-footer a:last-child {
    justify-self: start;
}

.form-footer .dot {
    justify-self: center;
    color: var(--gray);
    font-size: 18px;
    line-height: 1;
}

.form-footer a {
    text-decoration: none;
    font-size: 18px;
    color: var(--gray);
    font-weight: 500;
    transition: color 0.2s, text-decoration 0.2s;
}

.modal-container label {
    display: block;
    margin-bottom: 0.25em;
    color: var(--gray-light);
    font-size: 0.95em;
    width: fit-content;
}

.modal-form input, select, textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5em 1em;
    border: 1px solid var(--gray-ultralight);
    height: 2.5em;
    border-radius: 0.5em;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.info {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5em 1em;
    color: var(--gray);
    border: 0;
    background: var(--yellow-ultraligh);
    border-radius: 0.5em;
    font-size: 0.875em;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-overflow: ellipsis;
}

.error {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5em 1em;
    border: 0;
    color: #dc2626;
    background-color: #fee2e2;
    border-radius: 0.5em;
    font-size: 0.875em;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-overflow: ellipsis;
}

.error-box {
    margin-bottom: 1em;
    font-size: 0.875em;
    border-radius: 0.5em;
    padding: 0.5em 1em;
}

.modal-form input:not([type="date"]) {
    padding-right: 1.5em;
}

.modal-form textarea {
    resize: none;
    height: 5em;
    padding: 0.5em 0.5em;
}

.modal-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: "";
    position: absolute;
    right: 1em;
    top: 50%;
    width: 0.5em;
    height: 0.5em;
    border-right: 0.1em solid var(--gray);
    border-bottom: 0.1em solid var(--gray);
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
}

.select-wrap:has(select:valid:required)::after {
    border-right: 0.1em solid var(--green-valid);
    border-bottom: 0.1em solid var(--green-valid);
}

.modal-form input[type="checkbox"]:focus {
    border: 1px solid var(--gray-ultralight);
}

.modal-form input[type="checkbox"]:checked {
    background-color: var(--yellow);
}

.modal-form input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}


.modal-form input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 0.3em;
    height: 0.7em;
    border: solid var(--gray);
    border-width: 0 2px 2px 0;
}

.modal-form input[type="checkbox"] {
    appearance: none;
    padding: 0;
    height: 1.5em;
    width: 1.5em;
    margin: 0;
    cursor: pointer;

    position: relative;
    display: inline-block;
}

.modal-form input:focus, select:focus {
    outline: none;
    border-color: #FFF9C4;
    box-shadow: 0 0 0 2px #FFF59D;
}

.form-item {
    margin-bottom: 1em;
    width: 100%;
}

.form-row {
    display: flex;
    gap: 1em
}

.error-box {
    margin-bottom: 1em;
    font-size: 0.875em;
    color: #dc2626;
    background-color: #fee2e2;
    border-radius: 0.5em;
    padding: 0.5em 1em;
}

.video-container h2 {
    padding: 0.5em;
    margin: 0;
}

.form-field {
    position: relative;
}


.form-field:has(input:not([type="checkbox"]):not([type="date"]):invalid:not(:placeholder-shown))::after {
    content: "";
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    width: 1em;
    height: 1em;
    background: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.22 4.22L11.78 11.78M11.78 4.22L4.22 11.78' stroke='%23F44336' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
    pointer-events: none;
}

.form-field:has(input:not([type="checkbox"]):not([type="date"]):valid:not(:placeholder-shown))::after {
    content: "";
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 10L3.5 7.5L2.5 8.5L6 12L14 4L13 3L6 10Z' fill='%2343A047'/%3E%3C/svg%3E");
    pointer-events: none;
}