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

:root {
    --primary-color: #4B0082;
    --secondary-color: #8A2BE2;
    --accent-color: #9370DB;
    --success-color: #28a745;
    --error-color: #dc3545;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s;
}

.logo a:hover {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

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

/* Form Section */
.form-section {
    padding: 3rem 0;
}

.form-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.form-description {
    color: #666;
    margin-bottom: 2rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.required {
    color: var(--error-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group input.error {
    border-color: var(--error-color);
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
}

.turnstile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Loading Spinner */
.loading-container {
    text-align: center;
    padding: 2rem 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-text {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Download Section */
.download-section {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.download-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* About Section */
.about-section {
    padding: 4rem 0;
    background: var(--white);
}

.about-section h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

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

.about-content > p {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.info-card p {
    color: #555;
    line-height: 1.8;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .form-card {
        padding: 1.5rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Blog Article Styles */
.blog-article {
    padding: 3rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.blog-article article {
    background: var(--white);
    border-radius: 10px;
    padding: 3rem;
    box-shadow: var(--shadow);
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--light-bg);
}

.article-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-meta {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

.article-intro {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.05), rgba(138, 43, 226, 0.05));
    border-left: 4px solid var(--secondary-color);
    border-radius: 5px;
}

.article-intro .lead {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.article-intro p {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.article-intro p:last-child {
    margin-bottom: 0;
}

.article-content {
    line-height: 1.8;
}

.article-content h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0 1.5rem 2rem;
    padding-left: 1rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.article-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.article-content em {
    color: var(--secondary-color);
    font-style: italic;
}

.article-content a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Highlight Box for callouts */
.highlight-box {
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.08), rgba(138, 43, 226, 0.08));
    border-left: 4px solid var(--secondary-color);
    border-radius: 5px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.highlight-box p {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.highlight-box p:last-child {
    margin-bottom: 0;
}

.highlight-box strong {
    color: var(--primary-color);
}

.highlight-box a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.highlight-box a:hover {
    text-decoration: underline;
}

/* Formula Box for equations/formulas */
.formula-box {
    background: var(--light-bg);
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.formula-box p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.formula-box p:first-child {
    font-size: 1.3rem;
    color: var(--primary-color);
}

/* Responsive Blog Article */
@media (max-width: 768px) {
    .blog-article {
        padding: 2rem 0;
    }

    .blog-article article {
        padding: 1.5rem;
    }

    .article-header h1 {
        font-size: 1.5rem;
    }

    .article-content h2 {
        font-size: 1.3rem;
        margin-top: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.1rem;
    }

    .highlight-box,
    .formula-box {
        padding: 1.5rem;
    }

    .formula-box {
        font-size: 0.95rem;
    }
}
