:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--light);
    color: var(--secondary);
    line-height: 1.6;
}

header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

section {
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--gray);
    max-width: 600px;
    text-align: center;
    margin: 0 auto 2rem auto;
}

.benefits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0 3rem;
    max-width: 960px;
}

.benefit-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    flex: 1 1 250px;
    max-width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.benefit-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.benefit-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Workflow Section */
.workflow-section {
    background-color: var(--light);
    border-top: 1px solid var(--border);
    padding-bottom: 2rem;
}

.workflow-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    margin-top: 2rem;
}

.workflow-step {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.step-image {
    width: 180px;
    height: 180px;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--gray);
}

.step-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step-description {
    color: var(--gray);
    font-size: 0.95rem;
}

/* OCR Tool Section */
.ocr-section {
    background-color: white;
    padding: 4rem 1.5rem;
    border-top: 1px solid var(--border);
    scroll-margin-top: 2rem;
}

.ocr-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.ocr-tool {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.upload-container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.file-input-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-wrapper:hover {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 3rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--gray);
    text-align: center;
}

.preview-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
    display: none;
}

.preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
    display: none;
}

.preview-container.visible {
    visibility: visible;
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.results-container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    border: 1px solid var(--border);
    text-align: left;
    margin-top: 2rem;
    display: none;
}

.results-container.visible {
    display: block;
}

.results-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.results-text {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    background-color: #f1f5f9;
    border-radius: 0.25rem;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    font-size: 0.875rem;
}

.action-button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.action-button:hover {
    background-color: var(--primary-dark);
}

.action-button:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
}

footer {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .benefits, .workflow-steps {
        flex-direction: column;
        align-items: center;
    }

    .benefit-card, .workflow-step {
        max-width: 100%;
    }

    .upload-container, .results-container {
        padding: 1.5rem;
    }
}


#loading-spinner {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top: 4px solid #4F46E5; /* a nice blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#loading-spinner.hidden {
    display: none;
}

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


/* Form Styling */
.signup-form {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.signup-form div {
    margin-bottom: 1rem;
}

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

.signup-form input[type="email"],
.signup-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border);
    font-size: 1rem;
    color: var(--secondary);
    background-color: var(--light);
    transition: border-color 0.2s;
}

.signup-form input[type="email"]:focus,
.signup-form input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
}

.signup-form button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.signup-form button:hover {
    background-color: var(--primary-dark);
}

.signup-form button:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
}

.signup-form .error-message {
    color: red;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.signup-form .success-message {
    color: green;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
