/* Value Stacking P2 - Stay Connected Page Styles */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.page-template-page-vs-p2-stay-connected {
    font-family: 'Kanit', sans-serif;
    background: #E7243B;
    overflow-x: hidden;
    color: #ffffff;
}

/* Preload State - Hide everything until JS adds 'loaded' class */
body.page-template-page-vs-p2-stay-connected:not(.loaded) .vs-p2-hero-content,
body.page-template-page-vs-p2-stay-connected:not(.loaded) .vs-p2-floating-images,
body.page-template-page-vs-p2-stay-connected:not(.loaded) .vs-p2-floating-elements {
    opacity: 0;
    visibility: hidden;
}

/* Ready State - Show content when JS adds 'loaded' class */
body.page-template-page-vs-p2-stay-connected.loaded .vs-p2-hero-content,
body.page-template-page-vs-p2-stay-connected.loaded .vs-p2-floating-images,
body.page-template-page-vs-p2-stay-connected.loaded .vs-p2-floating-elements {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease 0.05s;
}

.vs-p2-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    background: #E7243B;
}

/* Hero Section */
.vs-p2-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 120px; /* Account for fixed header */
}

.vs-p2-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

/* Floating Images - Same patterns as P2/P3/P4 */
.vs-p2-floating-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.vs-p2-float-img {
    position: absolute;
    max-width: 120px;
    height: auto;
    opacity: 0;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    transform: translateY(100px) rotate(-180deg);
}

.vs-p2-float-1 {
    top: 15%;
    left: 8%;
    max-width: 100px;
    animation: vs-p2-float1 8s ease-in-out infinite;
}

.vs-p2-float-2 {
    top: 25%;
    right: 12%;
    max-width: 110px;
    animation: vs-p2-float2 10s ease-in-out infinite reverse;
}

.vs-p2-float-3 {
    bottom: 30%;
    left: 5%;
    max-width: 95px;
    animation: vs-p2-float3 12s ease-in-out infinite;
}

.vs-p2-float-4 {
    top: 60%;
    right: 8%;
    max-width: 105px;
    animation: vs-p2-float4 9s ease-in-out infinite reverse;
}

.vs-p2-float-5 {
    bottom: 15%;
    right: 20%;
    max-width: 115px;
    animation: vs-p2-float5 11s ease-in-out infinite;
}

.vs-p2-float-6 {
    top: 45%;
    left: 15%;
    max-width: 90px;
    animation: vs-p2-float6 7s ease-in-out infinite reverse;
}

/* Floating Animations - Same as P2/P3/P4 */
@keyframes vs-p2-float1 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    25% { transform: translateY(-30px) translateX(20px) rotate(5deg); }
    50% { transform: translateY(-15px) translateX(-10px) rotate(-3deg); }
    75% { transform: translateY(-35px) translateX(15px) rotate(8deg); }
}

@keyframes vs-p2-float2 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    33% { transform: translateY(-25px) translateX(-15px) rotate(-5deg); }
    66% { transform: translateY(-40px) translateX(25px) rotate(7deg); }
}

@keyframes vs-p2-float3 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    25% { transform: translateY(-20px) translateX(30px) rotate(10deg); }
    50% { transform: translateY(-35px) translateX(-20px) rotate(-8deg); }
    75% { transform: translateY(-10px) translateX(15px) rotate(4deg); }
}

@keyframes vs-p2-float4 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    40% { transform: translateY(-30px) translateX(-25px) rotate(-6deg); }
    80% { transform: translateY(-15px) translateX(10px) rotate(9deg); }
}

@keyframes vs-p2-float5 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    30% { transform: translateY(-40px) translateX(20px) rotate(12deg); }
    70% { transform: translateY(-20px) translateX(-30px) rotate(-7deg); }
}

@keyframes vs-p2-float6 {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    50% { transform: translateY(-25px) translateX(-15px) rotate(-10deg); }
}

.vs-p2-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.vs-p2-content-wrapper {
    width: 100%;
}

/* Main Title */
.vs-p2-main-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(100px) scale(0.8);
}

.vs-p2-highlight {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Subtitle */
.vs-p2-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 400;
    line-height: 1.6;
    color: #ffffff;
    max-width: 600px;
    margin: 0 auto 50px;
    opacity: 0;
    transform: translateY(50px);
}

.vs-p2-subtitle strong {
    color: #ffffff;
    font-weight: 600;
}

/* Form Container - WHITE BACKGROUND */
.vs-p2-form-container {
    background: #ffffff;
    border: 2px solid rgba(231, 36, 59, 0.2);
    border-radius: 25px;
    padding: 60px 50px;
    margin-top: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(80px) scale(0.9);
}

/* Form Styles */
.vs-p2-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    z-index: 2;
}

.vs-p2-form-group {
    position: relative;
    margin-bottom: 60px;
}

/* P2 Input Styles - Dark text on white background */
.vs-p2-input-container {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
}

.vs-p2-input {
    width: 100%;
    padding: 20px 0 20px 0;
    font-size: 1.4rem;
    font-weight: 500;
    color: #2c3e50;
    background: transparent;
    border: none;
    border-bottom: 3px solid rgba(231, 36, 59, 0.3);
    outline: none;
    font-family: 'Kanit', sans-serif;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    line-height: 1.5;
}

.vs-p2-input::placeholder {
    color: transparent;
}

.vs-p2-input:focus {
    border-bottom-color: #E7243B;
}

/* P2 Label Styles - Dark text */
.vs-p2-label {
    position: absolute;
    left: 0;
    top: 20px;
    font-size: 1.4rem;
    color: #7f8c8d;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.4s ease;
    font-family: 'Kanit', sans-serif;
    z-index: 1;
}

/* P2 Label Animation */
.vs-p2-input:focus + .vs-p2-label,
.vs-p2-input:valid + .vs-p2-label,
.vs-p2-input:not(:placeholder-shown) + .vs-p2-label {
    transform: translateY(-35px) scale(0.85);
    color: #E7243B;
    font-weight: 600;
}

/* Keep label position when input has value */
.vs-p2-input:not(:focus):valid + .vs-p2-label,
.vs-p2-input:not(:focus):not(:placeholder-shown) + .vs-p2-label {
    transform: translateY(-35px) scale(0.85);
    color: #2c3e50;
    font-weight: 500;
}

/* Has value state */
.vs-p2-input.has-value + .vs-p2-label {
    transform: translateY(-35px) scale(0.85);
    color: #2c3e50;
    font-weight: 500;
}

.vs-p2-input.has-value:focus + .vs-p2-label {
    color: #E7243B;
    font-weight: 600;
}

/* P2 Underline Animation */
.vs-p2-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #E7243B, #FED638, #E7243B);
    background-size: 200% 100%;
    transition: width 0.5s ease;
    animation: vs-p2-underline-glow 2s ease-in-out infinite;
}

.vs-p2-input:focus ~ .vs-p2-underline {
    width: 100%;
}

@keyframes vs-p2-underline-glow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Error Messages for duplicate check */
.vs-p2-error-message {
    color: #e74c3c;
    font-size: 0.95rem;
    margin-top: 8px;
    display: none;
    animation: slideDown 0.3s ease;
    font-weight: 500;
}

.vs-p2-error-message.show {
    display: block;
}

/* Success Messages for validation */
.vs-p2-success-message {
    color: #27ae60;
    font-size: 0.95rem;
    margin-top: 8px;
    display: none;
    animation: slideDown 0.3s ease;
    font-weight: 500;
}

.vs-p2-success-message.show {
    display: block;
}

/* Loading Messages */
.vs-p2-loading-message {
    color: #3498db;
    font-size: 0.95rem;
    margin-top: 8px;
    display: none;
    animation: slideDown 0.3s ease;
    font-weight: 500;
}

.vs-p2-loading-message.show {
    display: block;
}

.vs-p2-loading-message::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid #3498db;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

/* Success state for inputs */
.vs-p2-input.success {
    border-bottom-color: #27ae60;
}

.vs-p2-input.success + .vs-p2-label {
    color: #27ae60;
}

.vs-p2-input.success ~ .vs-p2-underline {
    background: #27ae60;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tips Section - Adjusted colors for white background */
.vs-p2-tips-section {
    background: rgba(231, 36, 59, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(231, 36, 59, 0.2);
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
}

.vs-p2-tips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.vs-p2-tips-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Tips Button - Red theme to match P2 */
.vs-p2-tips-btn {
    background: #E7243B;
    color: #ffffff;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
}

.vs-p2-tips-btn:hover {
    background: #408aee;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(64, 138, 238, 0.3);
}

.vs-p2-tips-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(64, 138, 238, 0.2);
}

.vs-p2-tips-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    margin-top: 15px;
}

.vs-p2-tips-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
    margin: 0;
}

/* Submit Button */
.vs-p2-submit-button {
    background: #E7243B;
    color: #ffffff;
    border: 3px solid #E7243B;
    padding: 18px 80px;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    margin: 50px auto 0;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Kanit', sans-serif;
    box-shadow: 8px 8px 0px 0px #FED638;
    min-width: 250px;
    text-align: center;
}

.vs-p2-submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.vs-p2-submit-button:hover::before {
    left: 100%;
}

.vs-p2-submit-button:hover {
    background: #408aee;
    color: #ffffff;
    border-color: #408aee;
    transform: translateY(-3px);
    box-shadow: 10px 10px 0px 0px #FED638;
}

.vs-p2-submit-button:active {
    transform: translateY(0px);
    box-shadow: 4px 4px 0px 0px #FED638;
}

.vs-p2-btn-text {
    position: relative;
    z-index: 2;
}

/* Loading state for submit button */
.vs-p2-submit-button.loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
}

.vs-p2-submit-button.loading .vs-p2-btn-text::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

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

/* Login Section */
.vs-p2-login-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(231, 36, 59, 0.15);
}

.vs-p2-login-text {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin: 0;
    font-weight: 400;
}

.vs-p2-login-link {
    color: #E7243B;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    padding: 2px 8px;
    margin-left: 5px;
}

.vs-p2-login-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #E7243B, #FED638);
    transition: width 0.3s ease;
}

.vs-p2-login-link:hover {
    color: #408aee;
    transform: translateY(-1px);
}

.vs-p2-login-link:hover::after {
    width: 100%;
}

/* Additional Floating Elements */
.vs-p2-floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.vs-p2-float-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(254, 214, 56, 0.15), rgba(255, 127, 165, 0.15));
    animation: vs-p2-circle-float 20s linear infinite;
}

.vs-p2-float-circle-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    right: 15%;
    animation-delay: -2s;
}

.vs-p2-float-circle-2 {
    width: 60px;
    height: 60px;
    bottom: 25%;
    left: 10%;
    animation-delay: -8s;
}

.vs-p2-float-circle-3 {
    width: 100px;
    height: 100px;
    top: 70%;
    right: 25%;
    animation-delay: -15s;
}

.vs-p2-float-triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid rgba(37, 26, 247, 0.2);
    top: 35%;
    left: 20%;
    animation: vs-p2-triangle-rotate 18s linear infinite;
}

.vs-p2-float-square {
    position: absolute;
    width: 35px;
    height: 35px;
    background: rgba(255, 127, 165, 0.2);
    top: 80%;
    left: 30%;
    animation: vs-p2-square-bounce 14s ease-in-out infinite;
    transform: rotate(45deg);
}

@keyframes vs-p2-circle-float {
    0%, 100% { transform: translateY(0px) translateX(0px) rotate(0deg); }
    25% { transform: translateY(-40px) translateX(25px) rotate(90deg); }
    50% { transform: translateY(-20px) translateX(-20px) rotate(180deg); }
    75% { transform: translateY(-50px) translateX(15px) rotate(270deg); }
}

@keyframes vs-p2-triangle-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes vs-p2-square-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0px); }
    50% { transform: rotate(45deg) translateY(-25px); }
}

/* Error States */
.vs-p2-input.error {
    border-bottom-color: #e74c3c;
    animation: vs-p2-error-shake 0.6s ease-in-out;
}

.vs-p2-input.error + .vs-p2-label {
    color: #e74c3c;
}

.vs-p2-input.success {
    border-bottom-color: rgba(231, 36, 59, 0.3);
}

.vs-p2-input.success + .vs-p2-label {
    color: #2c3e50;
}

@keyframes vs-p2-error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* P5 Validation Messages */
.vs-form-message {
    position: absolute;
    bottom: -50px;
    left: 0;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    background: rgba(231, 36, 59, 0.95);
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(231, 36, 59, 0.3);
    white-space: nowrap;
    max-width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    z-index: 10;
}

.vs-form-message.error {
    background: rgba(231, 36, 59, 0.95);
    color: #ffffff;
    border-color: #e74c3c;
}

.vs-form-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vs-p2-hero {
        padding: 100px 0 60px 0;
    }
    
    .vs-p2-form-container {
        padding: 40px 30px;
        margin-top: 30px;
        border-radius: 20px;
    }
    
    .vs-p2-form {
        gap: 0;
    }
    
    .vs-p2-input {
        font-size: 1.2rem;
        padding: 15px 0;
        border-bottom-width: 2px;
    }
    
    .vs-p2-label {
        font-size: 1.2rem;
        top: 15px;
    }
    
    .vs-p2-input:focus + .vs-p2-label,
    .vs-p2-input:valid + .vs-p2-label,
    .vs-p2-input:not(:placeholder-shown) + .vs-p2-label,
    .vs-p2-input.has-value + .vs-p2-label {
        transform: translateY(-30px) scale(0.85);
    }
    
    .vs-p2-input:not(:focus):valid + .vs-p2-label,
    .vs-p2-input:not(:focus):not(:placeholder-shown) + .vs-p2-label {
        transform: translateY(-30px) scale(0.85);
        color: #2c3e50;
        font-weight: 500;
    }
    
    .vs-p2-submit-button {
        padding: 15px 60px;
        font-size: 1.2rem;
        box-shadow: 6px 6px 0px 0px #FED638;
        margin-top: 30px;
        min-width: 220px;
    }
    
    .vs-p2-submit-button:hover {
        box-shadow: 8px 8px 0px 0px #FED638;
    }
    
    .vs-p2-tips-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .vs-p2-tips-btn {
        align-self: center;
        max-width: 150px;
    }
    
    /* Adjust floating images for mobile */
    .vs-p2-float-img {
        max-width: 80px;
        opacity: 0.5;
    }
    
    .vs-p2-float-1 { max-width: 70px; }
    .vs-p2-float-2 { max-width: 75px; }
    .vs-p2-float-3 { max-width: 65px; }
    .vs-p2-float-4 { max-width: 70px; }
    .vs-p2-float-5 { max-width: 80px; }
    .vs-p2-float-6 { max-width: 60px; }
    
    /* Adjust floating elements */
    .vs-p2-float-circle-1 { width: 60px; height: 60px; }
    .vs-p2-float-circle-2 { width: 45px; height: 45px; }
    .vs-p2-float-circle-3 { width: 75px; height: 75px; }
    
    .vs-p2-float-square { width: 25px; height: 25px; }
}

@media (max-width: 480px) {
    .vs-p2-form-container {
        padding: 30px 20px;
    }
    
    .vs-p2-input {
        font-size: 1.1rem;
    }
    
    .vs-p2-label {
        font-size: 1.1rem;
    }
    
    .vs-p2-submit-button {
        padding: 12px 40px;
        font-size: 1.1rem;
        min-width: 200px;
        box-shadow: 4px 4px 0px 0px #FED638;
    }
    
    .vs-p2-submit-button:hover {
        box-shadow: 6px 6px 0px 0px #FED638;
    }
    
    .vs-form-message {
        font-size: 0.9rem;
        padding: 6px 12px;
        bottom: -45px;
        white-space: normal;
        max-width: 90%;
    }
    
    .vs-p2-form-group {
        margin-bottom: 0px;
    }
    
    .vs-p2-tips-section {
        padding: 20px 15px;
    }
    
    .vs-p2-tips-title {
        font-size: 1.1rem;
    }
    
    .vs-p2-tips-text {
        font-size: 1rem;
    }
    
    .vs-p2-login-text {
        font-size: 1rem;
    }
}

/* Animated state classes - for smooth entrance */
.vs-p2-main-title.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.vs-p2-subtitle.animated {
    opacity: 1;
    transform: translateY(0);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}

.vs-p2-form-container.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.9s;
}

.vs-p2-float-img.animated {
    opacity: 0.7;
    transform: translateY(0) rotate(0deg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(231, 36, 59, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FED638, #E7243B);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #E7243B, #FED638);
}

/* Ripple effect styles */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}