@charset "UTF-8";

/**
 * Contact Form 7 Styling
 * Matches PtasiSerwis theme design system:
 * - Sharp edges (0 border-radius)
 * - Primary red accent (#EC2526)
 * - Montserrat typography
 * - Compact centered layout
 * - Strong shadows for depth
 */

/* ==========================================================================
   Form Container
   ========================================================================== */

.wpcf7 {
    max-width: 420px;
    margin: 0 auto;
    padding: var(--space-4, 1rem);
}

.wpcf7 form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
}

/* ==========================================================================
   Form Paragraphs & Labels
   ========================================================================== */

.wpcf7 p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
}

.wpcf7 label {
    font-family: var(--ptasi-font-family, "Montserrat", sans-serif);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ptasi-text, #111117);
    line-height: 1.5;
    display: block;
}

.wpcf7 label br {
    display: none; /* Remove <br> from labels for cleaner layout */
}

/* ==========================================================================
   Form Inputs & Textarea
   ========================================================================== */

.wpcf7-form-control-wrap {
    display: block;
    position: relative;
    width: 100%;
}

.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 {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--ptasi-font-family, "Montserrat", sans-serif);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--ptasi-text, #111117);
    background-color: var(--ptasi-surface, #fff);
    border: 1px solid rgba(var(--ptasi-light-rgb, 224 224 224), 0.6);
    border-radius: 0;
    outline: none;
    transition: all 220ms ease;
    box-sizing: border-box;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 input[type="number"]:focus,
.wpcf7 input[type="date"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    border-color: var(--ptasi-primary, #EC2526);
    box-shadow: 0 0 0 3px rgba(var(--ptasi-primary-rgb, 236 37 38), 0.1);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Textarea specific */
.wpcf7 textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Date input specific */
.wpcf7 input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.wpcf7 input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 220ms ease;
}

.wpcf7 input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Select dropdown specific */
.wpcf7 select {
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="%23111117" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

/* Placeholder styling */
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
    color: var(--ptasi-muted, #6D7076);
    opacity: 0.6;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.wpcf7 p:has(input[type="submit"]),
.wpcf7 p:has(.wpcf7-submit) {
    align-items: center;
}

.wpcf7 input[type="submit"],
.wpcf7 .wpcf7-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 2.5rem;
    font-family: var(--ptasi-font-family, "Montserrat", sans-serif);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ptasi-text, #111117);
    background-color: var(--ptasi-primary, #EC2526);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 320ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 0;
    width: auto;
}

/* Dark background overlay animation */
.wpcf7 input[type="submit"]::before,
.wpcf7 .wpcf7-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background-color: rgba(0, 0, 0, 0.15);
    transition: height 320ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

/* Airplane icon on hover */
.wpcf7 input[type="submit"]::after,
.wpcf7 .wpcf7-submit::after {
    content: '✈';
    position: absolute;
    left: 1.5rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 320ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    font-size: 1.125rem;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 .wpcf7-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.wpcf7 input[type="submit"]:hover::before,
.wpcf7 .wpcf7-submit:hover::before {
    height: 100%;
}

.wpcf7 input[type="submit"]:hover::after,
.wpcf7 .wpcf7-submit:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 .wpcf7-submit:hover {
    padding-left: 3.5rem;
    font-weight: 900;
}

.wpcf7 input[type="submit"]:active,
.wpcf7 .wpcf7-submit:active {
    transform: translateY(0);
}

.wpcf7 input[type="submit"]:focus-visible,
.wpcf7 .wpcf7-submit:focus-visible {
    outline: 2px solid var(--ptasi-primary, #EC2526);
    outline-offset: 4px;
}

/* Disabled state during submission */
.wpcf7 input[type="submit"]:disabled,
.wpcf7 .wpcf7-submit:disabled,
.wpcf7-form.submitting input[type="submit"],
.wpcf7-form.submitting .wpcf7-submit {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   Validation & Error Messages
   ========================================================================== */

/* Invalid field border */
.wpcf7-form-control.wpcf7-not-valid {
    border-color: var(--ptasi-primary, #EC2526) !important;
    box-shadow: 0 0 0 3px rgba(var(--ptasi-primary-rgb, 236 37 38), 0.15) !important;
}

/* Error message below field */
.wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ptasi-primary, #EC2526);
    line-height: 1.4;
}

/* General response output (success/error messages) */
.wpcf7-response-output {
    margin-top: 0;
    margin-bottom: var(--space-4, 1rem);
    padding: var(--space-4, 1rem) var(--space-6, 1.5rem);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.6;
    border-radius: 0;
    border-left: 4px solid;
    order: -1; /* Position above submit button */
}

.wpcf7-response-output[aria-hidden="true"] {
    display: none;
}

/* Force show when has message class (CF7 fallback) */
.wpcf7-response-output.wpcf7-validation-errors,
.wpcf7-response-output.wpcf7-mail-sent-ng,
.wpcf7-response-output.wpcf7-mail-sent-ok,
.wpcf7-response-output.wpcf7-spam-blocked,
.wpcf7-response-output.wpcf7-acceptance-missing {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* Error response */
.wpcf7-response-output.wpcf7-validation-errors,
.wpcf7-response-output.wpcf7-mail-sent-ng {
    color: #8B0000;
    background-color: rgba(var(--ptasi-primary-rgb, 236 37 38), 0.1);
    border-left-color: var(--ptasi-primary, #EC2526);
}

/* Success response */
.wpcf7-response-output.wpcf7-mail-sent-ok {
    color: #155724;
    background-color: #d4edda;
    border-left-color: #28a745;
}

/* Spam/error response */
.wpcf7-response-output.wpcf7-spam-blocked,
.wpcf7-response-output.wpcf7-acceptance-missing {
    color: #856404;
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.wpcf7 .wpcf7-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-left: 0.75rem;
    vertical-align: middle;
    border: 3px solid rgba(var(--ptasi-primary-rgb, 236 37 38), 0.2);
    border-top-color: var(--ptasi-primary, #EC2526);
    border-radius: 50%;
    animation: wpcf7-spin 0.8s linear infinite;
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease;
}

.wpcf7-form.submitting .wpcf7-spinner {
    opacity: 1;
    visibility: visible;
}

@keyframes wpcf7-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Screen Reader Text
   ========================================================================== */

.wpcf7 .screen-reader-response {
    position: absolute;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    word-wrap: normal !important;
}

/* ==========================================================================
   Acceptance Checkbox (GDPR/Terms)
   ========================================================================== */

.wpcf7 .wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.wpcf7 .wpcf7-acceptance input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    cursor: pointer;
    flex-shrink: 0;
}

.wpcf7 .wpcf7-list-item {
    margin: 0;
}

.wpcf7 .wpcf7-list-item-label {
    font-weight: 400;
    font-size: 0.9375rem;
    line-height: 1.6;
    cursor: pointer;
}

/* ==========================================================================
   Quiz/CAPTCHA Fields
   ========================================================================== */

.wpcf7 .wpcf7-quiz-label,
.wpcf7 .wpcf7-captcha-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   File Upload
   ========================================================================== */

.wpcf7 input[type="file"] {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.wpcf7 input[type="file"]::-webkit-file-upload-button {
    padding: 0.5rem 1rem;
    font-family: var(--ptasi-font-family, "Montserrat", sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ptasi-text, #111117);
    background-color: var(--ptasi-background, #F8F8F8);
    border: 1px solid rgba(var(--ptasi-light-rgb, 224 224 224), 0.6);
    border-radius: 0;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 220ms ease;
}

.wpcf7 input[type="file"]::-webkit-file-upload-button:hover {
    background-color: var(--ptasi-light, #E0E0E0);
}

/* ==========================================================================
   Hidden Fields Container
   ========================================================================== */

.wpcf7 .hidden-fields-container {
    display: none;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .wpcf7 {
        max-width: 100%;
        padding: var(--space-4, 1rem);
    }

    .wpcf7 form {
        gap: var(--space-4, 1rem);
    }

    .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 {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .wpcf7 input[type="submit"],
    .wpcf7 .wpcf7-submit {
        width: 100%;
        padding: 0.875rem 2rem;
        font-size: 0.9375rem;
    }

    .wpcf7 input[type="submit"]:hover,
    .wpcf7 .wpcf7-submit:hover {
        padding-left: 3rem;
    }

    .wpcf7-response-output {
        margin-top: var(--space-4, 1rem);
        padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .wpcf7 * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .wpcf7 .wpcf7-spinner,
    .wpcf7-response-output {
        display: none !important;
    }
}
