:root {
    --primary-color: #51b86d;
    --primary-hover-color: #003d00;
    --background-color: #f7f9f7;
    --text-color: #333;
    --card-background-color: #fff;
    --border-color: #e0e0e0;
    --font-family: 'Manrope', sans-serif;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

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

/* Header */
.header {
    background-color: var(--card-background-color);
    box-shadow: var(--box-shadow);
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 24px;
    font-weight: 700;
}

.logo img {
    height: 40px;
    width: auto;
    margin-right: 10px;
}

/* Main Content */
.app-state {
    padding: 40px 0;
}

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 20px;
    color: #4e606a;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dropzone:hover, .dropzone.dragover {
    background-color: #e8f5e9;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dropzone i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Steps Overview */
.steps-overview {
    display: flex;
    justify-content: space-around;
}

.step-item {
    text-align: center;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 20px;
}

/* Progress State */
.progress-card {
    background-color: var(--card-background-color);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.progress-steps {
    margin-top: 20px;
}

.progress-steps .step {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    opacity: 0.5;
}

.progress-steps .step.active {
    opacity: 1;
}

.progress-steps .step i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Results State */
.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-card {
    background-color: var(--card-background-color);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    padding: 40px;
}

.results-score {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.score-donut {
    width: 150px;
    height: 150px;
    margin-right: 40px;
}

.score-summary h3 {
    font-size: 36px;
    margin: 0;
}

.results-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.triggers ul, .improvements ul {
    list-style: none;
    padding: 0;
}

.triggers li, .improvements li {
    padding-left: 20px;
    position: relative;
}

.triggers li::before, .improvements li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.results-actions {
    margin-top: 40px;
    text-align: center;
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
}

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

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

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--text-color);
}

/* SPA Views */
.view[hidden] {
    display: none;
}

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

#main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
}

/* Auth Forms */
.auth-form, .onboarding-form {
    max-width: 400px;
    margin: 40px auto;
    padding: 40px;
    background-color: var(--card-background-color);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    text-align: center;
}

.auth-form input, .onboarding-form input, .onboarding-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.auth-form button, .onboarding-form button {
    width: 100%;
}

.auth-form p {
    margin-top: 20px;
}

/* History View */
.history-item {
    background-color: var(--card-background-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Account View */
#account-details {
    background-color: var(--card-background-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 31, 18, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #1A3A28;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 420px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.auth-modal {
    color: #F9FAFB;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #F9FAFB;
    background: rgba(255, 255, 255, 0.1);
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #F9FAFB;
}

.modal-header p {
    color: #9CA3AF;
    font-size: 14px;
}

.auth-form-content .form-group {
    margin-bottom: 20px;
}

.auth-form-content label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #F9FAFB;
}

.auth-form-content input[type="email"],
.auth-form-content input[type="password"],
.auth-form-content input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(13, 31, 18, 0.6);
    border: 1px solid rgba(156, 163, 175, 0.2);
    border-radius: 10px;
    color: #F9FAFB;
    font-size: 15px;
    transition: all 0.2s ease;
}

.auth-form-content input::placeholder {
    color: #6B7280;
}

.auth-form-content input:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
}

.password-toggle:hover {
    color: #F9FAFB;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #9CA3AF;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    accent-color: #10B981;
}

.forgot-link {
    font-size: 14px;
    color: #10B981;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.btn-full {
    width: 100%;
}

.modal-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(156, 163, 175, 0.1);
}

.modal-footer p {
    color: #9CA3AF;
    font-size: 14px;
}

.modal-footer a {
    color: #10B981;
    text-decoration: none;
    font-weight: 500;
}

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

/* Modal overlay (for dynamic modals) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 31, 18, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

/* Verification Modal */
.verify-modal {
    color: #F9FAFB;
    text-align: center;
}

.verify-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: white;
}

.verify-body {
    color: #9CA3AF;
}

.verify-body p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.verify-body .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.verify-note {
    font-size: 13px;
    color: #6B7280;
    margin-top: 16px;
}

/* Spinner for buttons */
.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-success {
    background: #059669;
    color: white;
}

.toast-error {
    background: #DC2626;
    color: white;
}

.toast-info {
    background: #2563EB;
    color: white;
}

.toast-warning {
    background: #D97706;
    color: white;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: white;
}

/* Flagged Sentences Styles */
.flagged-sentences {
    margin-top: 30px;
}

.section-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.flagged-sentence-item {
    background: var(--card-background-color);
    border-left: 4px solid #ccc;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.flagged-sentence-item.severity-high {
    border-left-color: #f44336;
}

.flagged-sentence-item.severity-medium {
    border-left-color: #ff9800;
}

.flagged-sentence-item.severity-low {
    border-left-color: #ffc107;
}

.sentence-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.severity-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.severity-high .severity-badge {
    background-color: #ffebee;
    color: #c62828;
}

.severity-medium .severity-badge {
    background-color: #fff3e0;
    color: #e65100;
}

.severity-low .severity-badge {
    background-color: #fffde7;
    color: #f57f17;
}

.sentence-header .reason {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.original-sentence {
    margin: 10px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    font-style: italic;
    color: #444;
}

.suggestions {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.suggestions strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 14px;
}

.suggestions ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.suggestions li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.suggestions li:last-child {
    border-bottom: none;
}

.alternative-text {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.rationale {
    display: block;
    font-size: 13px;
    color: #777;
    font-style: italic;
}

.no-items {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Company Context Selector */
.company-context-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px auto;
    padding: 12px 20px;
    background: rgba(81, 184, 109, 0.08);
    border: 1px solid rgba(81, 184, 109, 0.2);
    border-radius: 12px;
    max-width: 500px;
}

.company-context-selector .context-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4e606a;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.company-context-selector .context-label i {
    color: var(--primary-color);
}

.company-select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234e606a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
    min-width: 180px;
}

.company-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(81, 184, 109, 0.15);
}

.company-select option {
    padding: 10px;
}

.manage-companies-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #4e606a;
    text-decoration: none;
    transition: all 0.2s ease;
}

.manage-companies-link:hover {
    background: rgba(81, 184, 109, 0.15);
    color: var(--primary-color);
}

/* Responsive adjustments for company selector */
@media (max-width: 600px) {
    .company-context-selector {
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }

    .company-select {
        width: 100%;
    }

    .manage-companies-link {
        position: absolute;
        right: 16px;
        top: 16px;
    }

    .company-context-selector {
        position: relative;
    }
}
