/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Design tokens */
:root {
    color-scheme: light only;
    --primary-navy: #051641;
    --primary-blue: #3770e2;
    --accent-blue: #45cdff;
    --text-primary: #051641;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --border-light: #e5e5e5;
    --border-subtle: #f0f0f0;
    --bg-white: #ffffff;
    --bg-subtle: #fafafa;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-white);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

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

/* Header */
.app-header {
    text-align: center;
    padding: 64px 24px 32px;
    max-width: 600px;
    margin: 0 auto;
}

.app-header .logo-link {
    display: inline-block;
    margin-bottom: 32px;
    opacity: 0.9;
}

.app-header .logo-link:hover {
    opacity: 1;
}

.app-header .logo-link img {
    height: 36px;
    width: auto;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.app-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Main content */
.main-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Upload section */
.upload-section {
    margin: 48px 0 0 0;
}

.upload-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-area {
    border: 1.5px dashed var(--border-light);
    border-radius: 12px;
    background: var(--bg-white);
    transition: all 0.2s ease;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-blue);
    background: var(--bg-subtle);
}

.upload-area .upload-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px auto;
    color: var(--text-muted);
}

.upload-area .upload-text {
    font-size: 14px;
    color: var(--text-muted);
}

.upload-area .upload-text strong {
    color: var(--primary-blue);
    font-weight: 500;
}

.upload-area .file-types {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-name {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    display: none;
}

.file-name.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.file-name .remove-file {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.file-name .remove-file:hover {
    color: var(--error);
    text-decoration: none;
}

/* Stage select */
.stage-section {
    margin-top: 24px;
}

.stage-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stage-select {
    width: 100%;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: all 0.15s ease;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a3a3a3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.stage-select:hover {
    border-color: var(--text-muted);
}

.stage-select:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Analyze button */
.analyze-btn {
    background: linear-gradient(135deg, #051641 0%, #0a2a6e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(5, 22, 65, 0.15);
    font-family: inherit;
}

.analyze-btn:hover {
    box-shadow: 0 4px 12px rgba(5, 22, 65, 0.25);
    transform: translateY(-1px);
}

.analyze-btn:active {
    transform: translateY(0);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Status area */
.status-area {
    margin-top: 16px;
}

.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-message .status-icon {
    font-weight: 600;
}

.status-message .status-text {
    font-size: 14px;
    font-weight: 500;
}

/* Progress section */
.progress-section {
    margin-top: 24px;
    display: none;
}

.progress-section.visible {
    display: block;
}

.progress-bar-track {
    background: var(--border-light);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Results section */
.results-section {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border-subtle);
    display: none;
}

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

/* Score display */
.score-display {
    text-align: center;
    padding: 40px 0;
}

.score-value {
    font-size: 72px;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1;
    letter-spacing: -2px;
}

.score-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 400;
}

.score-bar {
    margin: 32px auto;
    max-width: 320px;
}

.score-bar-track {
    background: var(--border-subtle);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
}

.score-badge .badge-label {
    font-size: 14px;
    font-weight: 500;
}

.score-badge .badge-sep {
    font-size: 12px;
    color: var(--text-muted);
}

.score-badge .badge-stage {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Analysis output */
.analysis-output {
    margin-top: 32px;
}

.analysis-output h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.analysis-output h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 28px 0 12px 0;
}

.analysis-output h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 8px 0;
}

.analysis-output p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 16px 0;
}

.analysis-output li {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 4px 0;
}

.analysis-output strong {
    color: var(--text-primary);
    font-weight: 600;
}

.analysis-output ul, .analysis-output ol {
    padding-left: 20px;
    margin: 0 0 16px 0;
}

/* Framework accordion */
.framework-section {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin-top: 48px;
    overflow: hidden;
}

.framework-section summary {
    padding: 16px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.framework-section summary::-webkit-details-marker {
    display: none;
}

.framework-section summary::after {
    content: "";
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23a3a3a3' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.framework-section[open] summary::after {
    transform: rotate(180deg);
}

.framework-content {
    padding: 0 20px 20px;
}

.framework-content h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 12px 0;
}

.framework-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 8px 0;
}

.framework-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 12px 0;
    font-size: 14px;
}

.framework-content li {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 14px;
    margin: 2px 0;
}

.framework-content ul {
    padding-left: 20px;
    margin: 0 0 12px 0;
}

.framework-content hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 16px 0;
}

.framework-content em {
    font-size: 13px;
    color: var(--text-muted);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 48px 24px;
    margin-top: 64px;
    border-top: 1px solid var(--border-light);
}

.app-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.app-footer .footer-framework {
    font-size: 13px;
    margin-bottom: 24px;
}

.app-footer .disclaimer {
    max-width: 700px;
    margin: 0 auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.app-footer .disclaimer p {
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.6;
}

.app-footer .disclaimer a {
    color: #9ca3af;
    font-weight: 400;
}

/* Responsive */
@media (max-width: 640px) {
    .app-container {
        padding: 0 16px;
    }

    .upload-section {
        margin: 32px 0 0 0;
    }

    .app-header {
        padding: 40px 16px 24px;
    }

    .app-header h1 {
        font-size: 2rem;
    }
}
