* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
    color: var(--text-primary);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.captcha-section {
    margin-bottom: 2rem;
}

.captcha-container {
    position: relative;
    background: var(--bg-color);
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

#captchaImage {
    max-width: 100%;
    max-height: 250px;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    display: none;
}

#captchaImage.loaded {
    display: block;
}

.loader {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    position: absolute;
}

.loader.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-section {
    display: grid;
    gap: 1rem;
}

.status {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-left: 4px solid var(--warning-color);
    border-radius: 0.5rem;
    font-weight: 500;
}

.status.processing {
    border-left-color: var(--warning-color);
}

.status.success {
    border-left-color: var(--success-color);
    background: #f0fdf4;
    color: #166534;
}

.status.error {
    border-left-color: var(--error-color);
    background: #fef2f2;
    color: #991b1b;
}

.result-container {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.result-container label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3em;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    text-align: center;
    word-break: break-all;
}

.timer {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-section {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.info-section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.info-section code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

.example {
    margin-top: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

footer {
    text-align: center;
    color: white;
    margin-top: 2rem;
    padding-top: 1rem;
}

footer p {
    margin: 0.25rem 0;
    opacity: 0.9;
}

footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s;
}

footer a:hover {
    border-bottom-color: white;
}

.license {
    font-size: 0.875rem;
    opacity: 0.7;
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 1.5rem;
    }

    .captcha-container {
        padding: 1.5rem;
        min-height: 250px;
    }

    .result-text {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
    }
}
