/* Brixzly Contact Form Styles - Floating Form Elements */

.brixzly-contact-form-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0px 0px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* min-height: 500px; */
}

.brixzly-contact-form-wrapper {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: visible;
}

.brixzly-form-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #231f20;
    margin: 0 0 20px 0;
    text-align: center;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 10;
}

.brixzly-form-description {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    margin: 0 0 40px 0;
    line-height: 1.6;
    position: relative;
    z-index: 10;
}

/* Form Container */
.brixzly-contact-form {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 670px !important;
}

/* Base Shape Styles */
.brixzly-shape {
    position: absolute;
    background: #fff;
    border: 2px solid #231f20;
    border-radius: 12px;
    opacity: 0.9;
    transition: all 0.3s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    box-sizing: border-box;
}

/* Form Field Shapes */
.brixzly-form-field {
    z-index: 5;
    cursor: pointer;
}

.brixzly-form-field:hover {
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 10px 25px rgba(35, 31, 32, 0.2);
}

.brixzly-form-field.focused {
    transform: scale(1.08);
    opacity: 1;
    box-shadow: 0 15px 35px rgba(35, 31, 32, 0.3);
    z-index: 8;
}

/* Decorative Shapes */
.brixzly-decorative {
    z-index: 1;
    opacity: 0.6;
}

.brixzly-decorative:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* Shape Positions and Sizes */
.brixzly-shape-1 {
    /* Name Field */
    width: 176px;
    height: 82px;
    top: 20px;
    left: 20px;
    animation: floatIn 1.2s ease-out 0.1s both;
}

.brixzly-shape-2 {
    /* Email Field */
    width: 176px;
    height: 82px;
    top: 20px;
    right: 120px;
    animation: floatIn 1.2s ease-out 0.2s both;
}

.brixzly-shape-3 {
    /* Subject Field */
    width: 176px;
    height: 82px;
    top: 120px;
    right: 20px;
    animation: floatIn 1.2s ease-out 0.3s both;
}

.brixzly-shape-4 {
    /* Message Field - Large */
    width: 368px;
    height: 185px;
    top: 120px;
    left: 20px;
    animation: floatIn 1.2s ease-out 0.4s both;
}

.brixzly-shape-5 {
    /* Turnstile Field */
    width: 330px;
    height: 70px;
    top: 320px;
    left: 120px;
    animation: floatIn 1.2s ease-out 0.5s both;
    padding: 0px !important;
}

.brixzly-shape-6 {
    /* Send Button */
    width: 82px;
    height: 185px;
    top: 220px;
    right: 20px;
    animation: floatIn 1.2s ease-out 0.6s both;
}

.brixzly-shape-7 {
    /* Decorative square - between Name and Email */
    width: 82px;
    height: 82px;
    top: 20px;
    left: 40%;
    transform: translateX(-50%);
    animation: floatIn 1.2s ease-out 0.7s both;
}

.brixzly-shape-8 {
    /* Decorative square - top right */
    width: 82px;
    height: 82px;
    top: 20px;
    right: 20px;
    animation: floatIn 1.2s ease-out 0.8s both;
}

.brixzly-shape-9 {
    /* Decorative square - below Subject, moved left */
    width: 82px;
    height: 82px;
    top: 220px;
    right: 120px;
    animation: floatIn 1.2s ease-out 0.9s both;
}

.brixzly-shape-10 {
    /* Decorative square - bottom right */
    width: 82px;
    height: 82px;
    top: 320px;
    right: 120px;
    animation: floatIn 1.2s ease-out 1.0s both;
}

.brixzly-shape-11 {
    /* Decorative square - bottom left */
    width: 82px;
    height: 82px;
    top: 320px;
    left: 20px;
    animation: floatIn 1.2s ease-out 1.1s both;
}

/* Form Elements Inside Shapes */
.brixzly-form-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #231f20;
    margin-bottom: 5px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.brixzly-form-field input,
.brixzly-form-field textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-family: inherit;
    color: #231f20;
    text-align: left;
    outline: none;
    resize: none;
}

.brixzly-form-field input::placeholder,
.brixzly-form-field textarea::placeholder {
    color: #999;
    font-style: italic;
}

.brixzly-form-field input:focus,
.brixzly-form-field textarea:focus {
    outline: none;
}

/* Message Field Specific */
.brixzly-message-field {
    justify-content: flex-start;
    padding-top: 20px;
}

.brixzly-message-field textarea {
    height: 120px;
    text-align: left;
    line-height: 1.4;
}

/* Turnstile Field */
.brixzly-turnstile-field {
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 5px;
}

.brixzly-turnstile-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.brixzly-turnstile-container .cf-turnstile { width: 100% !important; height: 65px !important; max-width: 100%; display: flex; align-items: center; justify-content: center; }

.brixzly-turnstile-container iframe { width: 100% !important; height: 65px !important; border-radius: 8px; border: none !important; background: transparent !important; }

/* Additional Turnstile styling to remove borders and backgrounds */
.brixzly-turnstile-container {
    background: transparent !important;
    border: none !important;
}

.brixzly-turnstile-container .cf-turnstile {
    background: transparent !important;
    border: none !important;
}

/* Target the Turnstile widget directly */
.cf-turnstile {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.cf-turnstile iframe {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Override Turnstile's internal #content styling */
.brixzly-turnstile-container #content,
.brixzly-turnstile-container iframe #content,
.cf-turnstile #content {
    border: none !important;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Target any nested elements that might have borders */
.brixzly-turnstile-container *,
.cf-turnstile * {
    border: none !important;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}


/* Submit Button Field */
.brixzly-submit-field {
    justify-content: center;
    align-items: center;
    background: #231f20;
    color: #fff;
    border-color: #231f20;
    padding: 0;
}

.brixzly-submit-field:hover {
    background: #000;
    border-color: #000;
}

.brixzly-submit-btn {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.brixzly-submit-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.brixzly-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.brixzly-btn-loading {
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Animation Keyframes */
@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        opacity: 0.9;
        transform: translateY(0) scale(1);
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(1deg);
    }
    50% {
        transform: translateY(-20px) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(-1deg);
    }
}

/* Apply floating animation to all shapes */
.brixzly-shape {
    animation: floatIn 1.2s ease-out both, float 4s ease-in-out infinite;
}

/* Reduce mouse movement effects to prevent shaking */
.brixzly-contact-form-wrapper:hover .brixzly-shape {
    animation-play-state: paused;
    transition: all 0.2s ease-out;
}

.brixzly-shape-1 { animation-delay: 0.1s, 0s; }
.brixzly-shape-2 { animation-delay: 0.2s, 0.3s; }
.brixzly-shape-3 { animation-delay: 0.3s, 0.6s; }
.brixzly-shape-4 { animation-delay: 0.4s, 0.9s; }
.brixzly-shape-5 { animation-delay: 0.5s, 1.2s; }
.brixzly-shape-6 { animation-delay: 0.6s, 1.5s; }
.brixzly-shape-7 { animation-delay: 0.7s, 1.8s; }
.brixzly-shape-8 { animation-delay: 0.8s, 2.1s; }
.brixzly-shape-9 { animation-delay: 0.9s, 2.4s; }
.brixzly-shape-10 { animation-delay: 1.0s, 2.7s; }
.brixzly-shape-11 { animation-delay: 1.1s, 3s; }

/* Form Messages */
.brixzly-form-messages {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
}

.brixzly-success-message,
.brixzly-error-message {
    padding: 20px 30px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 300px;
}

.brixzly-success-message {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.brixzly-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Validation States */
.brixzly-form-field.error {
    border-color: #e74c3c;
    background: #fdf2f2;
    transition: all 0.3s ease-out;
}

.brixzly-form-field.success {
    border-color: #27ae60;
    background: #f0f9f4;
    transition: all 0.3s ease-out;
}

.brixzly-form-field.focused {
    transform: scale(1.08) !important;
    opacity: 1 !important;
    box-shadow: 0 15px 35px rgba(35, 31, 32, 0.3) !important;
    z-index: 8 !important;
    transition: all 0.2s ease-out !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .brixzly-contact-form-container {
        padding: 20px 10px;
    }
    
    .brixzly-contact-form-wrapper {
        height: 450px;
    }
    
    .brixzly-form-title {
        font-size: 2rem;
    }
    
    .brixzly-shape {
        padding: 10px;
    }
    
    .brixzly-form-field label {
        font-size: 0.7rem;
    }
    
    .brixzly-form-field input,
    .brixzly-form-field textarea {
        font-size: 0.8rem;
    }
    
    /* Adjust positions for mobile */
    .brixzly-shape-1 { width: 140px; height: 70px; }
    .brixzly-shape-2 { width: 200px; height: 70px; top: 280px; left: 80px; }
    .brixzly-shape-3 { width: 140px; height: 70px; }
    .brixzly-shape-4 { width: 280px; height: 150px; }
    .brixzly-shape-5 { width: 70px; height: 70px; }
    .brixzly-shape-6 { width: 70px; height: 150px; }
}

@media (max-width: 480px) {
    .brixzly-contact-form-wrapper {
        height: 400px;
    }
    
    .brixzly-form-title {
        font-size: 1.8rem;
    }
    
    .brixzly-form-description {
        font-size: 1rem;
    }
    
    /* Stack shapes vertically on very small screens */
    .brixzly-shape {
        position: relative !important;
        width: 90% !important;
        height: 60px !important;
        margin: 10px auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
    }
    
    .brixzly-message-field {
        height: 100px !important;
    }
    
    .brixzly-submit-field {
        height: 60px !important;
    }
}

/* Focus states for accessibility */
.brixzly-form-field:focus-within {
    outline: 3px solid #231f20;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .brixzly-shape {
        border-width: 3px;
    }
    
    .brixzly-form-field input,
    .brixzly-form-field textarea {
        font-weight: 600;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .brixzly-shape {
        animation: none;
    }
    
    .brixzly-form-field:hover {
        transform: none;
    }
}

/* ========================================
   RESPONSIVE DESIGN - TABLET & MOBILE
   ======================================== */

/* Tablet Styles (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .brixzly-contact-form-wrapper {
        height: 450px;
        max-width: 90%;
        margin: 0 auto;
    }
    
    /* Adjust shape sizes for tablet */
    .brixzly-shape {
        padding: 10px;
    }
    
    /* Name field - make smaller */
    .brixzly-shape-1 {
        width: 200px;
        height: 65px;
        top: 20px;
        left: 20px;
    }
    
    /* Email field - make smaller */
    .brixzly-shape-2 {
        width: 200px;
        height: 65px;
        top: 20px;
        left: 100%;
    }
    
    /* Subject field - make it small */
    .brixzly-shape-3 {
        width: 140px;
        height: 65px;
        top: 100px;
        left: 20px;
    }
    
    /* Message field - make it the large field */
    .brixzly-shape-4 {
        width: 400px;
        height: 150px;
        top: 100px;
        left: 180px;
    }
    
    /* Turnstile field - position below message field */
    .brixzly-shape-5 {
        width: 320px;
        height: 65px;
        top: 270px;
        left: 20px;
    }
    
    /* Send button - position below turnstile */
    .brixzly-shape-6 {
        width: 200px;
        height: 65px;
        top: 350px;
        left: 20px;
    }
    
    /* Decorative squares - adjust positions for better tablet layout */
    .brixzly-shape-7 {
        width: 50px;
        height: 50px;
        top: 200px;
        left: 120px;
    }
    
    .brixzly-shape-8 {
        width: 50px;
        height: 50px;
        top: 20px;
        right: 50px;
    }
    
    .brixzly-shape-9 {
        width: 50px;
        height: 50px;
        top: 350px;
        left: 100%;
    }
    
    .brixzly-shape-10 {
        width: 50px;
        height: 50px;
        top: 350px;
        right: 80px;
    }
    
    .brixzly-shape-11 {
        width: 50px;
        height: 50px;
        top: 190px;
        right: 80px;
    }
    
    /* Adjust form field text sizes */
    .brixzly-form-field input,
    .brixzly-form-field textarea {
        font-size: 14px;
    }
    
    .brixzly-form-field label {
        font-size: 12px;
    }
    
    .brixzly-submit-button {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    /* Show labels on tablet */
    .brixzly-form-field label {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 12px;
        margin-bottom: 5px;
        color: #231f20;
        font-weight: 600;
    }
}

/* Mobile Styles (320px - 767px) */
@media screen and (max-width: 767px) {
    .brixzly-contact-form-wrapper {
        height: 600px;
        max-width: 95%;
        margin: 0 auto;
        padding: 10px;
    }
    
    /* Stack elements vertically on mobile */
    .brixzly-shape {
        position: relative !important;
        margin: 0 auto 15px auto !important;
        width: 100% !important;
        max-width: 300px;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        top: auto !important;
    }
    
    /* Name field */
    .brixzly-shape-1 {
        width: 100% !important;
        max-width: 300px;
        height: 60px;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* Email field */
    .brixzly-shape-2 {
        width: 100% !important;
        max-width: 300px;
        height: 60px;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* Message field */
    .brixzly-shape-3 {
        width: 100% !important;
        max-width: 300px;
        height: 100px;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* Subject field */
    .brixzly-shape-4 {
        width: 100% !important;
        max-width: 300px;
        height: 60px;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* Turnstile field */
    .brixzly-shape-5 {
        width: 100% !important;
        max-width: 300px;
        height: 60px;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* Send button */
    .brixzly-shape-6 {
        width: 100% !important;
        max-width: 200px;
        height: 50px;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* Hide decorative squares on mobile for cleaner look */
    .brixzly-shape-7,
    .brixzly-shape-8,
    .brixzly-shape-9,
    .brixzly-shape-10,
    .brixzly-shape-11 {
        display: none;
    }
    
    /* Adjust form field text sizes for mobile */
    .brixzly-form-field input,
    .brixzly-form-field textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
    }
    
    .brixzly-form-field label {
        display: none !important; /* Hide labels on mobile, use placeholders instead */
    }
    
    /* Style placeholders for mobile */
    .brixzly-form-field input::placeholder,
    .brixzly-form-field textarea::placeholder {
        color: #666;
        font-size: 14px;
        font-weight: 500;
    }
    
    .brixzly-submit-button {
        font-size: 16px;
        padding: 12px 24px;
        width: 100%;
    }
    
    /* Adjust Turnstile scaling for mobile */
    .brixzly-turnstile-container iframe {
        transform: scale(0.9);
    }
}

/* Small Mobile Styles (320px - 480px) */
@media screen and (max-width: 480px) {
    .brixzly-contact-form-wrapper {
        height: auto;
        min-height: 500px;
        padding: 5px;
    }
    
    .brixzly-shape {
        max-width: 100%;
    }
    
    .brixzly-form-field input,
    .brixzly-form-field textarea {
        font-size: 16px;
        padding: 10px;
    }
    
    .brixzly-submit-button {
        font-size: 14px;
        padding: 10px 20px;
    }
}
