@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
    --bg: #edf2fb;
    --card: #ffffff;
    --accent: #0a6ed1;
    --accent-dark: #0a4ea1;
    --border: #d4deed;
    --text: #182436;
    --muted: #5d6b85;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Source Sans 3', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page {
    flex: 1;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 0rem;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    margin-bottom: 1.25rem;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.logo-mark {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #daf0ff;
    color: var(--accent-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-stack h1 {
    margin: 0;
    font-size: 1.75rem;
}

.title-stack p {
    margin: 0.2rem 0 0;
    color: var(--muted);
}

.locale-switch span {
    font-size: 1.4rem;
    margin-left: 0.35rem;
}

.tab-nav {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--muted);
    border-radius: 0.75rem 0.75rem 0 0;
    font-weight: 600;
}

.tab.active {
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid var(--border);
    border-bottom: none;
}

main {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 15px 40px rgba(24, 36, 54, 0.08);
}

.form-panel {
    grid-row: 1 / 3
}

.form-panel form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
}

.file-field input {
    padding: 0.45rem 0.4rem;
}

.helper-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

button {
    align-self: flex-start;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

button:hover {
    background: var(--accent-dark);
}

.description-panel {
    grid-column: 2 / 4;
}

.description-panel p {
    margin-top: 0;
    color: var(--muted);
    line-height: 1.5;
}

.muted {
    color: var(--muted);
}

pre {
    background: #fff;
    border-radius: 10px;
    padding: 0.75rem;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.results-grid,
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.full-span {
    grid-column: 1 / 4;
}

.stats-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.stats-card li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.3rem;
}

.chart-wrapper {
    position: relative;
    min-height: 260px;
}

.chart-panel canvas {
    width: 100%;
    height: 240px;
}

.chart-wrapper .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.backend-card pre {
    max-height: 260px;
}

.backend-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.predicted-value {
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0.4rem 0 0.2rem;
    color: var(--accent-dark);
}

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
}

.alert-danger {
    background: #ffe6e6;
    color: #a31212;
}

.alert-info {
    background: #e6f0ff;
    color: #114b9c;
}

.site-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: var(--card);
    color: var(--muted);
    border-radius: 16px 16px 0 0;
    margin-top: 1.5rem;
}

#parent_project {
    margin: auto;
}

#certh_logo {
    margin: auto;
}

.footer_text {
    margin: auto;
}

.left_footer {
    margin: auto;
    padding: 0 15px 0 15px;
    text-align: left;
}

.right_footer {
    padding-left: 15px;
    text-align: right;
}

.footer_details {
    font-size: .8rem;
    color: var(--text);
    display: grid;
    gap: 0.2rem;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    button {
        width: 100%;
        text-align: center;
    }
}
