/* Demo Page Styles */

/* Demo Section */
.demo-section {
    padding-top: calc(var(--spacing-md) + 80px);
    /* Ensure clearance for fixed navbar */
    padding-bottom: var(--spacing-xl);
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

.demo-section .container {
    box-sizing: border-box;
}

.demo-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

@media (max-width: 968px) {
    .demo-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Demo Header (Left Column) */
.demo-header {
    position: sticky;
    top: 100px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding-top: 0.5rem;
}

.demo-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: var(--spacing-sm);
    color: var(--dark);
    line-height: 1.2;
}

.demo-subtitle {
    font-size: 1.125rem;
    color: var(--gray);
    margin-bottom: var(--spacing-sm);
}

.demo-note {
    font-size: 0.95rem;
    color: var(--gray);
    margin-bottom: var(--spacing-md);
    font-style: italic;
}

.demo-note .required {
    font-style: normal;
    font-weight: 600;
}

.demo-info-box {
    background: var(--primary);
    color: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 100%;
}

.demo-info-box h3 {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-decoration: none;
    color: var(--white);
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: var(--white);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-details {
    display: flex;
    flex-direction: column;
}

.contact-details .phone {
    font-weight: 700;
    font-size: 1.125rem;
}

.contact-details .label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Demo Form (Right Column) */
.demo-form-container {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--light-gray);
    max-width: 100%;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--light-gray);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 1rem;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--dark);
}

.form-group label .required {
    color: #e53e3e;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
    background-color: #f8fafc;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(101, 100, 219, 0.1);
}

.form-group input::placeholder {
    color: #a0aec0;
}

/* Input Validation Styles */
.form-group input.invalid,
.form-group select.invalid {
    border-color: #e53e3e;
    background-color: #fff5f5;
}

.form-group input.invalid:focus,
.form-group select.invalid:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    animation: slideDown 0.3s ease-out;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--gray);
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-group a {
    color: var(--primary);
    text-decoration: underline;
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
}

.form-actions .btn {
    width: 100%;
    justify-content: center;
}

.form-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Success/Error Notification */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    background: white;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 400px;
    max-width: 90%;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

.notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
}

.notification.success .notification-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.notification.error .notification-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--dark);
}

.notification-message {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.5;
}

.notification-close {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark);
}

@media (max-width: 600px) {
    .notification {
        min-width: unset;
        width: 90%;
        padding: 1.25rem 1.5rem;
    }

    .notification-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .notification-title {
        font-size: 1rem;
    }

    .notification-message {
        font-size: 0.875rem;
    }
}

/* Mobile Responsiveness Fixes */
@media (max-width: 968px) {

    /* Remove sticky positioning on mobile to prevent overlay issues */
    .demo-header {
        position: static;
    }

    /* Reduce top padding for better mobile spacing */
    .demo-section {
        padding-top: calc(var(--spacing-md) + 70px);
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Ensure demo content has proper padding on mobile */
    .demo-content {
        padding: 0;
        width: 100%;
    }

    /* Optimize title size for mobile screens */
    .demo-title {
        font-size: 1.75rem;
        line-height: 1.2;
        overflow-wrap: break-word;
    }

    /* Adjust subtitle for better readability */
    .demo-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    /* Improve spacing for demo note */
    .demo-note {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    /* Ensure contact info box fits properly with margins */
    .demo-info-box {
        margin-top: 1rem;
        margin-left: 0;
        margin-right: 0;
        padding: 1.25rem;
        width: 100%;
        max-width: calc(100vw - 2rem);
        box-sizing: border-box;
        overflow: hidden;
        word-wrap: break-word;
    }

    .demo-info-box h3 {
        font-size: 1.125rem;
        margin-bottom: 1.25rem;
    }

    /* Optimize form container for mobile */
    .demo-form-container {
        padding: 1.5rem;
        width: 100%;
        max-width: calc(100vw - 2rem);
        box-sizing: border-box;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .demo-title {
        font-size: 1.25rem;
    }

    .demo-subtitle {
        font-size: 0.875rem;
    }

    .demo-info-box,
    .demo-form-container {
        padding: 0.875rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .contact-card {
        padding: 0.5rem;
        gap: 0.75rem;
    }

    .contact-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .contact-details .phone {
        font-size: 0.95rem;
    }

    .contact-details .label {
        font-size: 0.75rem;
    }
}