/* ============================================
   CONTACT FORM 7 - Custom Styles
   ============================================ */

/* Container */
.wpcf7 { max-width: 100%; }
.wpcf7-form { display: flex; flex-direction: column; gap: 16px; }
.wpcf7-form p { margin: 0; }

/* Hide CF7 default line breaks between fields */
.wpcf7-form > p > br { display: none; }

/* Ensure each field wrapper (p tag) takes full width */
.wpcf7-form > p {
    width: 100%;
}

/* Labels */
.wpcf7-form label {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 500;
}

/* ============================================
   Inputs, Textareas, Selects - Global
   ============================================ */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form textarea,
.wpcf7-form select,
.wpcf7-form .wpcf7-text,
.wpcf7-form .wpcf7-email,
.wpcf7-form .wpcf7-textarea,
.wpcf7-form .wpcf7-select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 14px;
    color: var(--dark);
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(46,109,180,0.08);
}

.wpcf7-form input::placeholder,
.wpcf7-form textarea::placeholder {
    color: var(--text-muted);
}

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

/* Select dropdown */
.wpcf7-form select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ============================================
   Submit Button - Global
   ============================================ */
.wpcf7-form input[type="submit"],
.wpcf7-form .wpcf7-submit {
    display: block;
    width: 100%;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 15px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
    letter-spacing: 0.3px;
    position: relative;
}

.wpcf7-form input[type="submit"]:hover,
.wpcf7-form .wpcf7-submit:hover {
    background: var(--dark-blue, #1e4f8c);
    transform: translateY(-1px);
}

/* ============================================
   LOADING STATE - Spinner on submit
   ============================================ */
.wpcf7-form.submitting .wpcf7-submit,
.wpcf7-form.submitting input[type="submit"] {
    pointer-events: none;
    opacity: 0.7;
    color: transparent;
}

.wpcf7-form.submitting .wpcf7-submit::after,
.wpcf7-form.submitting input[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cf7-spin 0.6s linear infinite;
}

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

/* Also show loading via CF7's built-in spinner (re-styled) */
.wpcf7-spinner {
    visibility: visible !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid rgba(46,109,180,0.2) !important;
    border-top-color: var(--blue) !important;
    border-radius: 50% !important;
    animation: cf7-spin 0.6s linear infinite !important;
    background: none !important;
    margin: 8px auto 0 !important;
    opacity: 0;
    transition: opacity 0.2s;
}

.wpcf7-form.submitting .wpcf7-spinner {
    opacity: 1;
}

/* Hide spinner when not submitting */
.wpcf7-form:not(.submitting) .wpcf7-spinner {
    display: none !important;
}

/* ============================================
   Validation & Response messages
   ============================================ */
.wpcf7-not-valid {
    border-color: #e74c3c !important;
}

.wpcf7-not-valid-tip {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.wpcf7-form .wpcf7-response-output {
    border: none !important;
    padding: 14px 18px !important;
    margin: 12px 0 0 0 !important;
    border-radius: var(--radius-md) !important;
    font-size: 14px;
    text-align: center;
}

.wpcf7-form.sent .wpcf7-response-output {
    background: rgba(46, 109, 180, 0.08);
    color: var(--blue);
    border: 1px solid rgba(46, 109, 180, 0.2) !important;
}

.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.aborted .wpcf7-response-output {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2) !important;
}

.wpcf7-form.invalid .wpcf7-response-output {
    background: rgba(243, 156, 18, 0.08);
    color: #e67e22;
    border: 1px solid rgba(243, 156, 18, 0.2) !important;
}

/* ============================================
   Contact form (contact-grid) styles
   ============================================ */
.contact-grid .wpcf7-form {
    gap: 16px;
}

.contact-grid .wpcf7-form label {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 500;
}

/* ============================================
   Newsletter page (news-hero) styles
   ============================================ */
.news-hero .wpcf7-form {
    gap: 12px;
}

.news-hero .wpcf7-form label {
    display: none;
}

.news-hero .wpcf7 input[type="text"],
.news-hero .wpcf7 input[type="email"],
.news-hero .wpcf7 input.wpcf7-text,
.news-hero .wpcf7 input.wpcf7-email,
.news-hero .wpcf7 .wpcf7-form-control-wrap input {
    background: #FFFFFF !important;
    border: 1px solid #c5cdd6 !important;
    color: #0D1F33 !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

.news-hero .wpcf7 input[type="text"]:focus,
.news-hero .wpcf7 input[type="email"]:focus,
.news-hero .wpcf7 .wpcf7-form-control-wrap input:focus {
    border-color: #2E6DB4 !important;
    box-shadow: 0 0 0 3px rgba(46,109,180,0.1) !important;
    outline: none !important;
}

.news-hero .wpcf7 input::placeholder,
.news-hero .wpcf7 .wpcf7-form-control-wrap input::placeholder {
    color: #8899aa !important;
    opacity: 1 !important;
}

.news-hero .wpcf7-form .wpcf7-submit {
    margin-top: 4px;
}

.news-hero .wpcf7-form .wpcf7-response-output {
    color: var(--text-light);
}

.news-hero .wpcf7-form.sent .wpcf7-response-output {
    background: rgba(46, 109, 180, 0.08);
    color: var(--blue);
    border: 1px solid rgba(46, 109, 180, 0.2) !important;
}

/* ============================================
   Home page newsletter (news-box) styles
   ============================================ */
.news-box .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-box .wpcf7-form label {
    display: none;
}

.news-box .wpcf7-form input[type="text"],
.news-box .wpcf7-form input[type="email"],
.news-box .wpcf7-form .wpcf7-text,
.news-box .wpcf7-form .wpcf7-email {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 10px;
}

.news-box .wpcf7-form input[type="text"]:focus,
.news-box .wpcf7-form input[type="email"]:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(74,154,232,0.12);
}

.news-box .wpcf7-form input::placeholder {
    color: rgba(255,255,255,0.4);
}

.news-box .wpcf7-form .wpcf7-submit {
    margin-top: 4px;
}

.news-box .wpcf7-form .wpcf7-response-output {
    color: rgba(255,255,255,0.8);
}

.news-box .wpcf7-form.sent .wpcf7-response-output {
    background: rgba(74, 154, 232, 0.15);
    color: #7ec4ff;
    border: 1px solid rgba(74, 154, 232, 0.3) !important;
}

/* ============================================
   Consultoria form (proposta-box) styles
   ============================================ */
.proposta-box .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.proposta-box .wpcf7-form label {
    display: none;
}

/* Two-column row for name + email */
.proposta-box .wpcf7-form .cf7-row,
.proposta-box .cf7-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.proposta-box .cf7-row > span,
.proposta-box .cf7-row > .wpcf7-form-control-wrap {
    width: 100%;
}

.proposta-box .wpcf7-form textarea {
    min-height: 100px;
}

/* ============================================
   Mobile adjustments
   ============================================ */
@media (max-width: 600px) {
    .wpcf7-form input[type="text"],
    .wpcf7-form input[type="email"],
    .wpcf7-form input[type="tel"],
    .wpcf7-form textarea,
    .wpcf7-form select {
        font-size: 16px; /* prevents zoom on iOS */
        padding: 14px 16px;
    }

    .proposta-box .wpcf7-form .cf7-row,
    .proposta-box .cf7-row {
        grid-template-columns: 1fr;
    }
}
