body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-container {
    text-align: center;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    padding: 0 10px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.description {
    color: #6c757d;
    font-size: 13px;
    margin: 0 0 24px;
    line-height: 1.4;
    padding: 0 16px;
}

.captcha-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    margin: 0 auto;
}

.canvas-wrapper {
    width: 100%;
    position: relative;
    background-color: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    aspect-ratio: 4/3; /* This maintains the height proportionally */
}

#captchaCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    display: block;
}

.timer {
    display: none;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.mode-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    color: #2d3748;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    background-color: rgba(255, 255, 255, 0.97);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 10;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.mode-indicator.show {
    opacity: 1;
}

.progress-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.progress-indicator.show {
    opacity: 1;
}

.progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #e2e8f0;
    transition: background-color 0.2s ease;
}

.progress-dot.active {
    background-color: #0d6efd;
}

.btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 10px;
    height: 44px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin: 0 0 12px;
}

.btn:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.15);
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.status-message {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    box-sizing: border-box;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-message.error {
    background-color: #fff5f5;
    color: #e53e3e;
}

.status-message.success {
    background-color: #f0fff4;
    color: #38a169;
}

.status-message.neutral {
    background-color: #f8f9fa;
    color: #6c757d;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    pointer-events: none;
    animation: ripple 0.5s ease-out;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
}

@keyframes ripple {
    to {
        transform: scale(15);
        opacity: 0;
    }
}

/* Feature cards */
.demo-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px auto;
    max-width: 800px;
}

.feature-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.feature-card h3 {
    color: #0d6efd;
    margin-top: 0;
}

.feature-card p {
    color: #6c757d;
    margin: 0;
}

.demo-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
}

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.success-message {
    text-align: center;
    padding: 20px;
}

.success-message .checkmark {
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease-out;
}

.success-message h2 {
    color: #2c3e50;
    margin: 0 0 8px;
    font-size: 24px;
}

.success-message p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        transform: scale(0);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        min-height: 100vh;
        align-items: center;
    }
    
    .main-container {
        padding: 0 5px;
        max-width: 320px;
    }
    
    .captcha-container {
        padding: 10px;
    }
    
    .canvas-wrapper {
        margin-bottom: 8px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .description {
        font-size: 14px;
        margin-bottom: 20px;
        padding: 0 12px;
    }

    .btn {
        height: 48px;
        font-size: 16px;
        border-radius: 14px;
    }

    .status-message {
        border-radius: 14px;
        font-size: 14px;
        padding: 14px;
    }

    .timer {
        top: 16px;
        padding: 8px 16px;
        font-size: 15px;
        border-radius: 24px;
    }

    .mode-indicator {
        width: 80%;
        padding: 16px;
        font-size: 16px;
        border-radius: 16px;
    }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
