/* CSS Custom Properties for consistent theming */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #06b6d4;
    --accent-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --background-primary: #ffffff;
    --background-secondary: #f9fafb;
    --background-accent: #dbeafe;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-secondary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header and Navigation */
header {
    background-color: var(--background-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-light);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    height: 2.5rem;
    width: auto;
}

nav h1 {
    color: #2563eb;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
}

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

nav ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    position: relative;
}

nav ul li a:hover {
    color: var(--primary-color);
    background-color: var(--background-accent);
}

nav ul li a.active {
    color: var(--primary-color);
    background-color: var(--background-accent);
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="2"/></g></svg>') repeat;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.6;
}

/* Modern Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-primary);
    color: var(--primary-color);
    padding: 0.875rem 2rem;
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    letter-spacing: -0.01em;
}

.btn:hover {
    background-color: var(--background-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

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

/* Card-based Form Section */
.signup-form {
    padding: 5rem 0;
    background-color: var(--background-secondary);
}

.signup-form .container {
    max-width: 700px;
}

.form-card {
    background-color: var(--background-primary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
}

.signup-form h3 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.form-group {
    margin-bottom: 2rem;
}

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

/* Modern Input Styling */
input[type="email"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--background-primary);
    color: var(--text-primary);
}

input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Modern Grade Selection */
.grade-course-selection {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    background: linear-gradient(135deg, var(--background-primary) 0%, var(--background-accent) 100%);
}

.grade-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: var(--background-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.grade-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.grade-row:last-child {
    margin-bottom: 0;
}

.grade-label {
    font-weight: 600;
    min-width: 120px;
    margin-right: 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.grade-row label {
    display: flex;
    align-items: center;
    margin-right: 2rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.grade-row label:hover {
    color: var(--primary-color);
}

/* Custom Checkbox Styling */
.grade-row input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Philosophy page */
.philosophy {
    padding: 5rem 0;
    background-color: var(--background-primary);
}

.philosophy .container {
    max-width: 800px;
}

.philosophy h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.philosophy p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.philosophy ul {
    margin: 2rem 0;
    padding-left: 0;
    list-style: none;
}

.philosophy li {
    margin-bottom: 1rem;
    padding: 1.25rem;
    background-color: var(--background-secondary);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
    font-size: 1.05rem;
    line-height: 1.6;
}

.philosophy li strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Samples page */
.samples {
    padding: 5rem 0;
    background-color: var(--background-secondary);
}

.samples h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sample-newsletter {
    margin-bottom: 2.5rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    background-color: var(--background-primary);
}

.sample-newsletter h3 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem 2rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.newsletter-content {
    padding: 2rem;
}

.newsletter-content h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.newsletter-content h5 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Footer */
footer {
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: 3rem 0;
    margin-top: 5rem;
}

footer p {
    opacity: 0.8;
    font-size: 0.95rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    nav .container {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem 20px;
    }

    nav ul {
        justify-content: center;
        gap: 1rem;
    }

    nav ul li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h2 {
        font-size: 2.25rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1.125rem;
    }

    .form-card {
        padding: 2rem;
        margin: 0 1rem;
    }

    .signup-form h3 {
        font-size: 1.75rem;
    }

    .grade-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }

    .grade-label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .grade-row label {
        margin-right: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .philosophy h2,
    .samples h2 {
        font-size: 2rem;
    }

    .philosophy,
    .samples,
    .signup-form {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h2 {
        font-size: 2rem;
    }

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

    .form-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .grade-course-selection {
        padding: 1.5rem;
    }

    .grade-row {
        padding: 1.25rem;
    }

    .newsletter-content {
        padding: 1.5rem;
    }
}

/* Subtle animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero .container > * {
    animation: fadeInUp 0.6s ease-out;
}

.form-card {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Form message styling */
.form-message {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-align: center;
}

.form-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.form-message.loading {
    background-color: var(--background-accent);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Button loading state */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
