/* ========================================
   Shared form foundation
======================================== */

.form-control {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: var(--enerinno-ink);
    background: var(--enerinno-surface);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

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

select.form-control {
    cursor: pointer;
}

.form-control:hover {
    border-color: #aab3be;
}

.form-control:focus {
    border-color: var(--enerinno-orange);
    outline: none;
    box-shadow:
        0 0 0 3px rgba(255, 79, 18, 0.13);
}

.form-control:disabled {
    color: #8a94a1;
    background: #f1f3f5;
    cursor: not-allowed;
    opacity: 0.8;
}

/* ========================================
   Labels and help text
======================================== */

.form-group {
    min-width: 0;
}

.form-group > label {
    display: block;
    margin-bottom: 8px;
    color: #3d4653;
    font-size: 13px;
    font-weight: 700;
}

.form-help,
.helptext {
    display: block;
    margin-top: 7px;
    color: var(--enerinno-gray);
    font-size: 12px;
    line-height: 1.5;
}

.helptext ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.helptext li {
    margin-bottom: 4px;
}

/* ========================================
   Form errors
======================================== */

.errorlist {
    margin: 7px 0 0;
    padding: 0;
    color: #b42318;
    font-size: 12px;
    line-height: 1.5;
    list-style: none;
}

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

.form-errors {
    margin-top: 8px;
    color: #b42318;
    font-size: 13px;
}

.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 21px;
    padding: 13px 14px;
    border: 1px solid #f0b9b5;
    border-radius: 7px;
    color: #9e241c;
    background: #fff4f3;
    font-size: 12px;
    line-height: 1.5;
}

.form-alert p {
    margin: 0;
}

.form-alert .errorlist {
    margin-top: 0;
}

.form-alert-icon {
    display: grid;
    place-items: center;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    color: #ffffff;
    background: var(--enerinno-danger);
    font-size: 12px;
    font-weight: 700;
}

/* ========================================
   Checkbox controls
======================================== */

.form-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--enerinno-orange);
    cursor: pointer;
}

/* ========================================
   File controls
======================================== */

input[type="file"].form-control {
    padding: 8px;
    border-style: dashed;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    margin-right: 12px;
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    color: var(--enerinno-ink);
    background: var(--enerinno-gray-light);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

input[type="file"].form-control::file-selector-button:hover {
    color: var(--enerinno-orange-dark);
    background: var(--enerinno-orange-soft);
}

/* ========================================
   Required fields
======================================== */

.required-field::after {
    margin-left: 3px;
    color: var(--enerinno-danger);
    content: "*";
}

/* ========================================
   Browser autofill
======================================== */

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--enerinno-ink);
    box-shadow:
        0 0 0 1000px var(--enerinno-surface)
        inset;
}

/* ========================================
   Mobile forms
======================================== */

@media (max-width: 600px) {
    .form-control {
        font-size: 16px;
    }
}