/* ===============================================================
 * MODAL
 * ============================================================== */

.crc-modal {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    pointer-events: none;
    z-index: 100000;
}

.crc-modal.active {
    pointer-events: auto;
}


/* ===============================================================
 * OVERLAY
 * ============================================================== */

.crc-modal-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.4);

    opacity: 0;
    backdrop-filter: blur(0);

    transition:
        opacity 0.25s ease,
        backdrop-filter 0.25s ease;
}

.crc-modal.active .crc-modal-overlay {
    opacity: 1;
    backdrop-filter: blur(8px);
}


/* ===============================================================
 * MODAL CONTENT
 * ============================================================== */

.crc-modal-content {
    position: relative;
    z-index: 1;

    width: min(90%, 420px);
    max-height: 90dvh;

    padding: 30px;

    overflow-y: auto;

    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #fff;
    border-radius: 5px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);

    color: var(--base);

    opacity: 0;
    transform: translateY(-30px) scale(0.95);

    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

.crc-modal.active .crc-modal-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* ===============================================================
 * CLOSE BUTTON
 * ============================================================== */

.crc-modal-close {
    position: absolute;
    top: 0;
    right: 0;

    padding: 4px 6px;

    background: none;
    border: 0;
    color: var(--contrast-3);

    cursor: pointer;
    z-index: 2;
}

button.crc-modal-close:hover {
    color: var(--accent);
    background: none;
}


/* ===============================================================
 * CONTACT FORM 7 - FIELDS
 * ============================================================== */

.crc-field {
    position: relative;
    margin-bottom: 20px;
}

.crc-field .wpcf7-form-control-wrap {
    display: block;
}

.crc-field input[type="text"],
.crc-field input[type="email"],
.crc-field input[type="url"],
.crc-field input[type="password"],
.crc-field input[type="search"],
.crc-field input[type="tel"],
.crc-field input[type="number"],
.crc-field textarea,
.crc-field select {
    width: 100%;

    padding: 20px 14px 8px;

    border: 1px solid #ccc;
    border-radius: 3px;

    background-color: transparent;
    color: var(--contrast-3);

    font: inherit;
}

.crc-field input[type="text"],
.crc-field input[type="email"],
.crc-field input[type="url"],
.crc-field input[type="password"],
.crc-field input[type="search"],
.crc-field input[type="tel"],
.crc-field input[type="number"] {
    min-height: 54px;
}

.crc-field textarea {
    min-height: 130px;
    resize: vertical;
}


/* ===============================================================
 * FLOATING LABELS
 * ============================================================== */

.crc-field > label {
    position: absolute;
    left: 14px;
    top: 15px;

    margin: 0;

    color: #666;
    font-size: 16px;

    pointer-events: none;

    transition:
        top 0.18s ease,
        font-size 0.18s ease,
        color 0.18s ease;
}

.crc-field:focus-within > label,
.crc-field:has(input:not(:placeholder-shown)) > label,
.crc-field:has(textarea:not(:placeholder-shown)) > label {
    top: 5px;

    font-size: 11px;
    font-style: normal;

    color: var(--accent);
}


/* ===============================================================
 * FOCUS STATE
 * ============================================================== */

.crc-field input[type="text"]:focus,
.crc-field input[type="email"]:focus,
.crc-field input[type="url"]:focus,
.crc-field input[type="password"]:focus,
.crc-field input[type="search"]:focus,
.crc-field input[type="tel"]:focus,
.crc-field input[type="number"]:focus,
.crc-field textarea:focus,
.crc-field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: none;

    background-color: rgba(0, 0, 0, 0.25);
    color: #fff;
}


/* ===============================================================
 * VALIDATION
 * ============================================================== */

.crc-modal .wpcf7-not-valid {
    border: 1px solid #ff4d4f !important;
    background-color: transparent !important;
}


/* ===============================================================
 * SUBMIT BUTTON
 * ============================================================== */

.crc-field input[type="submit"] {
    display: block;

    width: 50%;
    margin: 0 auto;

    cursor: pointer;

    outline: none;
    border: 1px solid #ccc;
    box-shadow: none;

    background-color: transparent !important;
    color: #fff;

    font-weight: 300;
    font-style: italic;
}

.crc-field input[type="submit"]:hover {
    border-color: var(--accent);

    background-color: transparent !important;
    color: var(--accent);
}


/* ===============================================================
 * SPINNER
 * ============================================================== */

.crc-field .wpcf7-spinner {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);

    margin: 0;

    transform: translateX(-50%);
}


/* ===============================================================
 * CF7 RESPONSE
 * ============================================================== */

.crc-modal .wpcf7-response-output {
    margin-left: 0;
    margin-right: 0;
}

.crc-modal .wpcf7 form.invalid .wpcf7-response-output {
    color: #ff4d4f;

    border: 1px solid var(--accent) !important;
    border-radius: 3px;
}