/* Contact Form Modal — Modern glassmorphism matching BPR site design */

.contact-form-modal {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.contact-form-modal.active {
    display: flex;
}

.contact-form-panel {
    position: relative;
    width: 95%;
    max-width: 680px;
    margin: 0;
    padding: 2.5rem 2.75rem 2.25rem;
    border-radius: 24px;
    background: linear-gradient(
        145deg,
        rgba(26, 26, 26, 0.95) 0%,
        rgba(40, 20, 60, 0.88) 50%,
        rgba(26, 26, 26, 0.95) 100%
    );
    border: 2px solid rgba(145, 93, 250, 0.45);
    box-shadow:
        0 25px 80px rgba(101, 47, 202, 0.35),
        0 0 60px rgba(255, 77, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    overflow: hidden;
    animation: none;
}

.contact-form-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
    opacity: 0.45;
    z-index: 0;
}

.contact-form-glow--1 {
    width: 220px;
    height: 220px;
    top: -80px;
    right: -60px;
    background: rgba(145, 93, 250, 0.55);
    animation: contactGlowPulse 6s ease-in-out infinite;
}

.contact-form-glow--2 {
    width: 180px;
    height: 180px;
    bottom: -70px;
    left: -50px;
    background: rgba(255, 77, 0, 0.35);
    animation: contactGlowPulse 6s ease-in-out infinite 3s;
}

@keyframes contactGlowPulse {
    0%, 100% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.15); opacity: 0.55; }
}

.contact-form-close {
    position: absolute;
    top: 18px;
    right: 22px;
    float: none;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(145, 93, 250, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.4rem;
    line-height: 1;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

.contact-form-close:hover {
    color: #ff4d00;
    border-color: #ff4d00;
    background: rgba(255, 77, 0, 0.15);
    transform: rotate(90deg);
}

.contact-form-header {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 2rem;
}

.contact-form-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(101, 47, 202, 0.5), rgba(255, 77, 0, 0.25));
    border: 2px solid rgba(145, 93, 250, 0.5);
    box-shadow: 0 8px 30px rgba(145, 93, 250, 0.3);
    animation: contactIconFloat 4s ease-in-out infinite;
}

@keyframes contactIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.contact-form-icon-wrap i {
    font-size: 1.6rem;
    color: #fff;
    animation: contactIconTilt 4s ease-in-out infinite;
}

@keyframes contactIconTilt {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

.contact-form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.45rem;
    background: linear-gradient(90deg, #fff 0%, #915dfa 50%, #ff4d00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-form-header p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}

/* Form layout */
.contact-form-modern {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

.contact-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
    margin-bottom: 0;
}

.contact-form-modern .floating-label {
    position: relative;
    margin-bottom: 1.15rem;
    opacity: 0;
    transform: translateY(18px);
}

.contact-form-modal.active .contact-form-modern .floating-label,
.contact-form-modal.active .contact-submit-btn {
    opacity: 1;
    transform: translateY(0);
}

.contact-form-modern .floating-label input,
.contact-form-modern .floating-label textarea {
    width: 100%;
    padding: 1.35rem 1.1rem 0.55rem 1.1rem;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(145, 93, 250, 0.25);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease, transform 0.25s ease;
    box-sizing: border-box;
}

.contact-form-modern .floating-label textarea {
    min-height: 120px;
    max-height: 220px;
    resize: vertical;
    padding-top: 1.5rem;
}

.contact-form-modern .floating-label input:focus,
.contact-form-modern .floating-label textarea:focus {
    outline: none;
    border-color: #915dfa;
    background: rgba(0, 0, 0, 0.5);
    box-shadow:
        0 0 0 3px rgba(145, 93, 250, 0.15),
        0 0 25px rgba(255, 77, 0, 0.12);
    transform: translateY(-2px);
}

.contact-form-modern .floating-label label {
    position: absolute;
    left: 1rem;
    top: 1.05rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.contact-form-modern .floating-label label i {
    font-size: 0.85rem;
    color: rgba(145, 93, 250, 0.7);
    transition: color 0.3s ease;
}

.contact-form-modern .floating-label input:focus + label,
.contact-form-modern .floating-label input:not(:placeholder-shown) + label,
.contact-form-modern .floating-label textarea:focus + label,
.contact-form-modern .floating-label textarea:not(:placeholder-shown) + label {
    top: 0.35rem;
    font-size: 0.72rem;
    color: #915dfa;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.contact-form-modern .floating-label input:focus + label i,
.contact-form-modern .floating-label input:not(:placeholder-shown) + label i,
.contact-form-modern .floating-label textarea:focus + label i,
.contact-form-modern .floating-label textarea:not(:placeholder-shown) + label i {
    color: #ff4d00;
}

.contact-field--full {
    grid-column: 1 / -1;
}

/* Animated field underline accent */
.contact-form-modern .floating-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #652fca, #ff4d00);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.contact-form-modern .floating-label:focus-within::after {
    width: calc(100% - 2rem);
}

/* Submit button */
.contact-submit-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 1.05rem 2rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #652fca 0%, #915dfa 50%, #ff4d00 100%);
    background-size: 200% 200%;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 30px rgba(101, 47, 202, 0.4);
    opacity: 0;
    transform: translateY(18px);
    animation: contactBtnGradient 4s ease infinite;
}

@keyframes contactBtnGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.contact-submit-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: left 0.55s ease;
}

.contact-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(255, 77, 0, 0.35), 0 8px 25px rgba(101, 47, 202, 0.4);
}

.contact-submit-btn:hover .contact-submit-shimmer {
    left: 100%;
}

.contact-submit-btn:active {
    transform: translateY(-1px);
}

.contact-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.contact-submit-icon {
    display: flex;
    align-items: center;
    transition: transform 0.35s ease;
}

.contact-submit-btn:hover .contact-submit-icon {
    transform: translateX(4px);
}

.contact-submit-btn.is-sending .contact-submit-icon i {
    animation: contactSendSpin 0.8s linear infinite;
}

@keyframes contactSendSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Thank you modal */
.contact-thankyou-modal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
}

.contact-thankyou-modal.active {
    display: flex;
}

.contact-thankyou-panel {
    max-width: 440px;
    margin: 0;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.97), rgba(40, 20, 60, 0.9));
    border: 2px solid rgba(40, 167, 69, 0.4);
    box-shadow: 0 25px 70px rgba(40, 167, 69, 0.2);
    animation: none;
}

.contact-thankyou-panel .thank-you-animation {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 167, 69, 0.15);
    border: 2px solid rgba(40, 167, 69, 0.5);
    font-size: 2.8rem;
    color: #28a745;
    animation: contactThankPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes contactThankPop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.contact-thankyou-panel h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, #28a745, #20c997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-thankyou-panel p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Override legacy #contact-form rules from style.css */
#contact-form.contact-form-modern {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

#contact-form.contact-form-modern input,
#contact-form.contact-form-modern textarea {
    padding: 1.35rem 1.1rem 0.55rem 1.1rem;
    border: 2px solid rgba(145, 93, 250, 0.25);
    border-radius: 14px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.35);
    resize: vertical;
}

#contact-form.contact-form-modern textarea {
    min-height: 120px;
    max-height: 220px;
    padding-top: 1.5rem;
}

#contact-form.contact-form-modern input:focus,
#contact-form.contact-form-modern textarea:focus {
    border-color: #915dfa;
    box-shadow:
        0 0 0 3px rgba(145, 93, 250, 0.15),
        0 0 25px rgba(255, 77, 0, 0.12);
}

#contact-form.contact-form-modern .contact-submit-btn {
    background: linear-gradient(135deg, #652fca 0%, #915dfa 50%, #ff4d00 100%);
    background-size: 200% 200%;
    padding: 1.05rem 2rem;
    border-radius: 14px;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

#contact-form.contact-form-modern .contact-submit-btn:hover {
    background: linear-gradient(135deg, #652fca 0%, #915dfa 50%, #ff4d00 100%);
    background-size: 200% 200%;
}

#contact-modal .contact-form-panel {
    max-width: 680px;
    animation: none;
}

/* Field validation */
.contact-field-error {
    display: block;
    min-height: 1.25rem;
    margin-top: 0.35rem;
    padding-left: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: transparent;
    transition: color 0.25s ease;
}

.contact-field-error.is-visible {
    color: #ff6b6b;
    animation: contactFieldShake 0.4s ease;
}

.contact-form-modern .floating-label input.is-valid,
#contact-form.contact-form-modern input.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.12), 0 0 18px rgba(40, 167, 69, 0.08);
}

.contact-form-modern .floating-label input.is-invalid,
#contact-form.contact-form-modern input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12), 0 0 18px rgba(220, 53, 69, 0.08);
}

@keyframes contactFieldShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

@media (max-width: 640px) {
    .contact-form-panel {
        padding: 2rem 1.5rem 1.75rem;
    }

    .contact-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-form-header h2 {
        font-size: 1.65rem;
    }
}
