/**
 * Contact Form 7 Override Styles
 *
 * Styles for Contact Form 7 plugin to match K4 Rugged theme design.
 *
 * @package K4_Rugged
 */

/* ==========================================================================
   FORM WRAPPER
   ========================================================================== */

.wpcf7 {
    margin: 0;
    padding: 0;
}

.wpcf7-form {
    margin: 0;
}

/* ==========================================================================
   FORM FIELDS
   ========================================================================== */

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
    background: var(--k4-charcoal);
    border: 2px solid var(--k4-concrete);
    color: var(--k4-white);
    padding: 15px 20px;
    font-family: var(--k4-font-body);
    font-size: 16px;
    width: 100%;
    transition: var(--k4-transition);
    border-radius: 0;
    clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    border-color: var(--k4-primary-red);
    outline: none;
    box-shadow: 0 0 0 3px rgba(196, 30, 47, 0.2);
}

.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
    color: #888;
}

.wpcf7 textarea {
    min-height: 150px;
    resize: vertical;
}

.wpcf7 select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23c41e2f' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
    cursor: pointer;
}

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

.wpcf7 label {
    color: var(--k4-white);
    font-family: var(--k4-font-heading);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 8px;
}

/* Form rows with spacing */
.wpcf7 p {
    margin-bottom: 20px;
}

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

.wpcf7 input[type="submit"] {
    background: var(--k4-primary-red);
    color: var(--k4-white);
    font-family: var(--k4-font-heading);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 40px;
    border: none;
    cursor: pointer;
    transition: var(--k4-transition);
    clip-path: var(--k4-clip-angle);
    width: auto;
}

.wpcf7 input[type="submit"]:hover {
    background: var(--k4-dark-red);
    transform: translateY(-2px);
}

.wpcf7 input[type="submit"]:active {
    transform: translateY(0);
}

.wpcf7 input[type="submit"]:disabled {
    background: var(--k4-concrete);
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   CHECKBOXES & RADIO BUTTONS
   ========================================================================== */

.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--k4-primary-red);
    margin-right: 10px;
    cursor: pointer;
}

.wpcf7-checkbox label,
.wpcf7-radio label {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.wpcf7-list-item {
    margin-bottom: 10px;
}

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

.wpcf7-not-valid {
    border-color: #f44336 !important;
}

.wpcf7-not-valid-tip {
    color: #f44336;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* ==========================================================================
   RESPONSE MESSAGES
   ========================================================================== */

.wpcf7-response-output {
    padding: 20px 25px;
    margin: 20px 0 0;
    border-radius: 8px;
    font-size: 14px;
}

.wpcf7-mail-sent-ok,
.wpcf7 form.sent .wpcf7-response-output {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #4caf50;
}

.wpcf7-mail-sent-ng,
.wpcf7 form.failed .wpcf7-response-output {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #f44336;
}

.wpcf7-validation-errors,
.wpcf7 form.invalid .wpcf7-response-output {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #ff9800;
    color: #ff9800;
}

.wpcf7-spam-blocked,
.wpcf7 form.spam .wpcf7-response-output {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #f44336;
}

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

.wpcf7-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--k4-steel);
    border-top-color: var(--k4-primary-red);
    border-radius: 50%;
    animation: cf7-spin 0.8s linear infinite;
    margin-left: 15px;
    vertical-align: middle;
}

@keyframes cf7-spin {
    to { transform: rotate(360deg); }
}

.wpcf7 form.submitting .wpcf7-spinner {
    visibility: visible;
}

/* ==========================================================================
   FILE UPLOAD
   ========================================================================== */

.wpcf7 input[type="file"] {
    background: var(--k4-charcoal);
    border: 2px dashed var(--k4-concrete);
    color: var(--k4-white);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    width: 100%;
    clip-path: none;
    border-radius: 8px;
}

.wpcf7 input[type="file"]:hover {
    border-color: var(--k4-primary-red);
}

.wpcf7 input[type="file"]::file-selector-button {
    background: var(--k4-primary-red);
    color: var(--k4-white);
    font-family: var(--k4-font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    margin-right: 15px;
    transition: var(--k4-transition);
}

.wpcf7 input[type="file"]::file-selector-button:hover {
    background: var(--k4-dark-red);
}

/* ==========================================================================
   ACCEPTANCE (GDPR/Terms)
   ========================================================================== */

.wpcf7-acceptance {
    margin: 20px 0;
}

.wpcf7-acceptance label {
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
}

.wpcf7-acceptance a {
    color: var(--k4-primary-red);
    text-decoration: underline;
}

/* ==========================================================================
   QUIZ/CAPTCHA
   ========================================================================== */

.wpcf7-quiz {
    display: flex;
    gap: 15px;
    align-items: center;
}

.wpcf7-quiz-label {
    color: #ccc;
    font-size: 14px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .wpcf7 input[type="submit"] {
        width: 100%;
    }
}

/* ==========================================================================
   FORM LAYOUTS
   ========================================================================== */

/* Two column form layout */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row > span {
    flex: 1;
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Inline form (search style) */
.wpcf7-form.inline-form {
    display: flex;
    gap: 0;
}

.wpcf7-form.inline-form input[type="text"],
.wpcf7-form.inline-form input[type="email"] {
    flex: 1;
    border-right: none;
    clip-path: polygon(2% 0, 100% 0, 100% 100%, 0% 100%);
}

.wpcf7-form.inline-form input[type="submit"] {
    clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
    margin-left: -5px;
}
