/*
 * TRA-2577: the centimetre hints from /js/td-package-size-check.js, shared by
 * /quotes, the WordPress quote widgets and members quick booking. Loaded after
 * each surface's own stylesheet, so the invalid-field rules below win on order.
 */
.td-size-hints {
    clear: both;
    display: block;
    flex: 0 0 100%;
    width: 100%;
    max-width: 700px;
    padding: 0 0 16px;
    box-sizing: border-box;
    text-align: left;
    white-space: normal;
}

.td-size-hint {
    position: relative;
    margin: 4px 0 0;
    padding: 14px 16px 14px 22px;
    border: 1px solid #c62828;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
    text-transform: none;
}

.td-size-hint + .td-size-hint {
    margin-top: 8px;
}

.td-size-hint::before {
    content: '';
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: -1px;
    width: 6px;
    border-radius: 4px 0 0 4px;
    background: #c62828;
}

.td-size-hint--warning {
    border-color: #e0a800;
    background: #fff8e1;
}

.td-size-hint--warning::before {
    background: #e0a800;
}

.td-size-hint p.td-size-hint__title,
.td-size-hint p.td-size-hint__body {
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.td-size-hint p.td-size-hint__title {
    margin-bottom: 2px;
    color: #c62828;
    font-weight: 700;
}

.td-size-hint--warning p.td-size-hint__title {
    color: #7a5200;
}

.td-size-hint__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.td-size-hint .td-size-hint__btn {
    display: inline-block;
    width: auto;
    height: auto;
    min-height: 40px;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid #0d4a86;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    color: #0d4a86;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
    cursor: pointer;
}

.td-size-hint .td-size-hint__btn--primary {
    background: #0d4a86;
    color: #fff;
}

.td-size-hint .td-size-hint__btn:hover {
    background: #e8f0f8;
}

.td-size-hint .td-size-hint__btn--primary:hover {
    background: #0a3a6a;
}

.td-size-hint .td-size-hint__btn:focus-visible {
    outline: 2px solid #f26522;
    outline-offset: 2px;
}

/* An invalid package field: red border, red label, and the reason under it. */
.td-size-form .td-field-invalid input.error,
.td-size-form .td-field-invalid input.error:focus {
    border: 2px solid #c62828 !important;
    background-color: #fff !important;
    color: #222;
}

.td-size-form .td-field-invalid label {
    color: #c62828 !important;
}

.td-size-form .td-field-reason {
    display: block;
    margin-top: 4px;
    color: #c62828;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
}

/* /quotes and instant-quote.php: the fields are inline-blocks centred on each
   other, so an extra line under one would lift its label; sit the reason in
   the group's bottom padding instead. */
#frm-items .td-field-invalid,
#quote-block .td-field-invalid {
    position: relative;
}

#frm-items .td-field-reason,
#quote-block .td-field-reason {
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Phones stack one field per line with the label beside the input, so the
   reason can take its own line, indented to sit under the input. */
@media (max-width: 420px) {
    #frm-items .td-field-reason {
        position: static;
        margin: 2px 0 -8px 131px;
    }
}
