/*
 * Structural styling only — colors/spacing/typography are each theme's own
 * job, same division of responsibility as Support\Carousel's CSS vs. a
 * theme's cascade.
 */

form[data-corpo-form] {
    --corpo-form-banner-border-color: rgba(0, 0, 0, 0.3);
    --corpo-form-validate-color: #198754;
    --corpo-form-validate-light-color: rgb(25 135 84 / 0.1);
    --corpo-form-error-color: #dc3545;
    --corpo-form-error-light-color: rgb(220 53 69 / 0.1);
    --corpo-form-banner-radius: 10px;
}

.corpo-form-error {
    display: block;
    color: var(--corpo-form-error-color);
    font-size: .85em;
}

.corpo-form-error:empty {
    display: none;
}

.corpo-form-banner {
    display: none;
    padding: 1rem;
    border: 1px solid var(--corpo-form-banner-border-color);
    border-radius: var(--corpo-form-banner-radius);
    margin-bottom: 1rem;
}

.corpo-form-banner--success {
    background-color: var(--corpo-form-validate-light-color);
    color: var(--corpo-form-validate-color);
    border-color: var(--corpo-form-validate-color);
}

.corpo-form-banner--error {
    background-color: var(--corpo-form-error-light-color);
    color: var(--corpo-form-error-color);
    border-color: var(--corpo-form-error-color);
}

.corpo-form-banner:not(:empty) {
    display: block;
}

/*
 * International phone field (views/zones/forms/phone-field.php) — the
 * real <select> stays in the DOM but visually hidden until :focus, same
 * technique as WordPress core's own .screen-reader-text:focus, so a
 * keyboard/AT user tabbing to it gets the native picker; the flag+search
 * dropdown below is the pointer/JS-driven overlay for everyone else.
 */
.corpo-tel-intl {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}

.corpo-tel-intl-country {
    position: relative;
}

.corpo-tel-intl-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.corpo-tel-intl-select:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    overflow: visible;
    white-space: normal;
}

.corpo-tel-intl-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
}

.corpo-tel-intl-panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    width: max-content;
    min-width: 100%;
    max-height: 320px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.corpo-tel-intl-search {
    width: 100%;
}

.corpo-tel-intl-list {
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
}

.corpo-tel-intl-option {
    display: flex;
    gap: .5rem;
    align-items: center;
    cursor: pointer;
}

.corpo-tel-intl-option[hidden] {
    display: none;
}

.corpo-tel-intl-number {
    flex: 1 1 auto;
    min-width: 0;
}
