/**
 * File: assets/forms.css
 *
 * Styles for the contribution form, payment area and messages.
 * Everything is prefixed "tcsdrc-" so it cannot affect the theme or other plugins.
 */

.tcsdrc-wrapper {
    max-width: 640px;
    margin: 1.5em 0;
}

.tcsdrc-form fieldset {
    border: 1px solid #c8cfd4;
    border-radius: 6px;
    padding: 12px 16px 16px;
    margin: 0 0 18px;
}

.tcsdrc-form legend {
    font-weight: 600;
    padding: 0 6px;
}

.tcsdrc-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
}

.tcsdrc-row > .tcsdrc-field {
    flex: 1 1 180px;
    min-width: 0;
}

.tcsdrc-field {
    margin-bottom: 14px;
}

.tcsdrc-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.tcsdrc-field input[type="text"],
.tcsdrc-field input[type="email"],
.tcsdrc-field input[type="tel"],
.tcsdrc-field select,
.tcsdrc-other-amount input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    font-size: 16px;
    border: 1px solid #aeb7bd;
    border-radius: 4px;
    background: #fff;
}

.tcsdrc-invalid,
.tcsdrc-field .tcsdrc-invalid {
    border-color: #b32d2e !important;
}

.tcsdrc-required {
    color: #b32d2e;
}

.tcsdrc-error {
    display: block;
    min-height: 0;
    color: #b32d2e;
    font-size: 14px;
    margin-top: 3px;
}

/* Amount choices */
.tcsdrc-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tcsdrc-preset {
    position: relative;
    cursor: pointer;
}

.tcsdrc-preset input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.tcsdrc-preset span {
    display: inline-block;
    min-width: 70px;
    padding: 10px 18px;
    text-align: center;
    border: 2px solid #aeb7bd;
    border-radius: 6px;
    background: #fff;
    font-weight: 600;
}

.tcsdrc-preset input:checked + span {
    border-color: #2271b1;
    background: #e8f1f8;
    color: #135e96;
}

.tcsdrc-preset input:focus-visible + span {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.tcsdrc-other-amount {
    margin-top: 12px;
    max-width: 260px;
}

.tcsdrc-other-amount label {
    display: block;
    margin-bottom: 4px;
}

/* Public checkbox */
.tcsdrc-optout label {
    font-weight: 700;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.tcsdrc-optout input {
    margin-top: 4px;
}

/* Bot trap: invisible to people, still present in the page */
.tcsdrc-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Buttons */
.tcsdrc-submit {
    display: inline-block;
    padding: 12px 28px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
}

.tcsdrc-submit:hover,
.tcsdrc-submit:focus {
    background: #135e96;
}

.tcsdrc-submit[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.tcsdrc-cancel {
    margin-top: 16px;
    padding: 8px 14px;
    background: none;
    border: 1px solid #aeb7bd;
    border-radius: 4px;
    cursor: pointer;
}

/* Payment area */
.tcsdrc-payment {
    border: 1px solid #c8cfd4;
    border-radius: 6px;
    padding: 18px;
}

.tcsdrc-payment h3 {
    margin-top: 0;
}

.tcsdrc-card-element {
    padding: 12px;
    border: 1px solid #aeb7bd;
    border-radius: 4px;
    background: #fff;
    margin: 16px 0 8px;
}

.tcsdrc-card-errors {
    color: #b32d2e;
    min-height: 1.2em;
    margin-bottom: 10px;
}

/* Messages */
.tcsdrc-messages,
.tcsdrc-payment-messages {
    margin-top: 14px;
}

.tcsdrc-message {
    padding: 12px 16px;
    border-left: 4px solid #2271b1;
    background: #f0f6fc;
    border-radius: 3px;
    margin: 10px 0;
}

.tcsdrc-message p {
    margin: 0 0 0.8em;
}

.tcsdrc-message p:last-child {
    margin-bottom: 0;
}

.tcsdrc-success {
    border-left-color: #1a7f37;
    background: #edf8f0;
}

.tcsdrc-warning {
    border-left-color: #b26200;
    background: #fff7e8;
}

.tcsdrc-error.tcsdrc-message,
.tcsdrc-message.tcsdrc-error {
    border-left-color: #b32d2e;
    background: #fcf0f0;
    color: #8a2424;
    font-size: inherit;
}

@media (max-width: 480px) {
    .tcsdrc-submit {
        width: 100%;
    }
}
