/* mellowhire — minimal structural styles, inherits theme typography & colors */

:root {
    --creativehire-error: #dc2626;
    --creativehire-success: #16a34a;
    --creativehire-field-gap: 1rem;
}

/* Meta (location, employment type) */
.creativehire-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.creativehire-meta__item {
    display: inline-block;
    padding: 0.25em 0.75em;
    font-size: 0.875em;
    border: 1px solid currentColor;
    opacity: 0.7;
}

.creativehire-meta__item--posting-type {
    opacity: 1;
    font-weight: 600;
}

/* Closed notice */
.creativehire-closed {
    margin-top: 2rem;
    padding: 1rem;
    border: 1px solid var(--creativehire-error);
    color: var(--creativehire-error);
}

/* Form wrapper */
.creativehire-form-wrapper {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid;
    opacity: 1;
}

.creativehire-form__title {
    margin-bottom: 1.5rem;
}

/* Grid for half-width fields */
.creativehire-video-interview {
    grid-column: 1 / -1;
    min-width: 0;
    border: 1px solid #d9ded8;
    border-radius: 8px;
    padding: 1rem;
}

.creativehire-video-interview iframe {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-radius: 6px;
}

.creativehire-video-interview button {
    margin: 0.25rem 0.45rem 0.25rem 0;
    padding: 0.55rem 0.9rem;
    min-height: 2.75rem;
    border: 1px solid var(--mh-brand-accent, #9e402c);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--mh-brand-text, inherit);
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
}

.creativehire-video-interview button:not(:disabled):hover {
    background: var(--mh-brand-accent, #9e402c);
    color: var(--mh-brand-foreground, #fff);
}

.creativehire-video-interview button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.creativehire-video-interview [hidden] { display: none; }

.creativehire-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--creativehire-field-gap);
}

@media (max-width: 600px) {
    .creativehire-form__grid {
        grid-template-columns: 1fr;
    }
}

/* Fields */
.creativehire-field {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.creativehire-field--half-left {
    grid-column: 1 / 2;
}

.creativehire-field--half-right {
    grid-column: 2 / 3;
}

@media (max-width: 600px) {
    .creativehire-field--half-left,
    .creativehire-field--half-right {
        grid-column: 1 / -1;
    }
}

.creativehire-field__label {
    font-size: 0.875em;
    font-weight: 600;
}

.creativehire-field__required {
    color: var(--creativehire-error);
}

.creativehire-field__input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-size: 0.9375em;
    border: 1px solid;
    border-color: inherit;
    background: transparent;
}

.creativehire-field__input:focus {
    outline: 2px solid;
    outline-offset: -1px;
}

.creativehire-field__input--file {
    padding: 0.375rem;
    border-style: dashed;
}

textarea.creativehire-field__input {
    resize: vertical;
    min-height: 6rem;
}

select.creativehire-field__input {
    appearance: auto;
}

.creativehire-field__checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375em;
    cursor: pointer;
}

.creativehire-field__checkbox input {
    width: auto;
}

/* Actions */
.creativehire-form__actions {
    margin-top: 1.5rem;
}

.creativehire-form__submit {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    background: transparent;
}

.creativehire-form__submit:hover {
    opacity: 0.8;
}

.creativehire-form__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.creativehire-form__error {
    margin-top: 1rem;
    padding: 0.75rem;
    color: var(--creativehire-error);
    border: 1px solid var(--creativehire-error);
}

.creativehire-form__success {
    padding: 1rem;
    color: var(--creativehire-success);
    border: 1px solid var(--creativehire-success);
    margin-bottom: 1rem;
}

.creativehire-public__brand img { max-width: min(14rem, 100%); max-height: 4rem; object-fit: contain; }
.creativehire-public.has-workspace-branding .creativehire-form__submit {
    background: var(--mh-brand-accent, #1f2937);
    color: var(--mh-brand-foreground, white);
}

.creativehire-public[data-brand-background] {
    padding: clamp(1rem, 4vw, 2rem);
    border-radius: 0.75rem;
    background: var(--mh-brand-background);
}

.creativehire-public[data-brand-background] :is(.creativehire-field__input, .creativehire-video-interview textarea) {
    background: var(--mh-brand-background);
    border-color: var(--mh-brand-border, currentColor);
}

.creativehire-public[data-brand-border] :is(.creativehire-meta__item, .creativehire-form-wrapper, .creativehire-field__input, .creativehire-video-interview, .creativehire-form__submit) {
    border-color: var(--mh-brand-border);
}

.creativehire-public[data-brand-text],
.creativehire-public[data-brand-text] :where(p, h1, h2, h3, h4, h5, h6, ul, ol, li, a, small, label, select, textarea, input) {
    color: var(--mh-brand-text);
}

.creativehire-public[data-brand-text] :is(input, textarea)::placeholder {
    color: var(--mh-brand-text);
    opacity: 1;
}

.creativehire-public[data-brand-font],
.creativehire-public[data-brand-font] :where(p, h1, h2, h3, h4, h5, h6, ul, ol, li, a, small, label, button, input, select, textarea) {
    font-family: var(--mh-brand-font);
}

.creativehire-public[data-brand-background] :is(.creativehire-closed, .creativehire-form__error, .creativehire-form__success) {
    background: #fffefa;
    color: #9c2323;
}

.creativehire-public[data-brand-background] .creativehire-form__success { color: #1b6d3b; }
.creativehire-public[data-brand-background] .creativehire-closed p { color: inherit; }
