:root {
    --stat-purple-dark: #4b4b9a;
    --stat-purple: #6666cc;
    --stat-purple-medium: #8080d6;
    --stat-purple-light: #eeeeff;
    --stat-purple-pale: #f7f7ff;
    --stat-border: #b8b8db;
    --stat-text: #222222;
}

/*
 * This stylesheet is loaded only by statEntry.jsp.
 * Hide the shared side navigation only on the STAT entry page.
 */
#leftnav,
#leftnav + .dividerBody,
#maincontent + .dividerBody {
    display: none;
}

/* Expand the shared legacy layout after removing the side navigation. */
table[summary="Content Area"] {
    width: 100% !important;
    table-layout: fixed;
}

#maincontent {
    width: 100% !important;
    padding: 20px 32px 28px;
    box-sizing: border-box;
}

#maincontent > h1 {
    margin-top: 8px;
}

.stat-welcome {
    margin-bottom: 18px;
    color: var(--stat-text);
    font-size: 13px;
}

/* Error display */
.stat-error {
    margin: 10px 0 16px;
    padding: 10px 12px;
    border: 1px solid #b94a48;
    border-radius: 4px;
    color: #b94a48;
    background-color: #fdf2f2;
}

/* Common section layout */
.stat-section {
    margin: 18px 0 24px;
}

.stat-section-title {
    padding: 9px 12px;
    border: 1px solid var(--stat-purple-dark);
    border-radius: 5px 5px 0 0;
    color: #ffffff;
    background-color: var(--stat-purple);
    font-size: 16px;
    font-weight: bold;
}

/* Simplified authentication choices */
.stat-auth-panel {
    border: 1px solid var(--stat-border);
    border-top: 0;
    border-radius: 0 0 5px 5px;
    background-color: #ffffff;
    overflow: hidden;
}

.stat-auth-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 16px;
    border-bottom: 1px solid var(--stat-border);
}

.stat-auth-option:last-child {
    border-bottom: 0;
}

.stat-auth-option:nth-child(even) {
    background-color: var(--stat-purple-pale);
}

.stat-auth-copy {
    flex: 1 1 auto;
}

.stat-auth-heading {
    margin-bottom: 5px;
    color: #333366;
    font-size: 15px;
    font-weight: bold;
}

.stat-auth-copy p {
    margin: 0;
    color: var(--stat-text);
    font-size: 13px;
    line-height: 1.45;
}

.stat-auth-action {
    flex: 0 0 230px;
    text-align: right;
}

.stat-auth-action form,
.stat-panel-row form {
    margin: 0;
}

/* Common panel body */
.stat-panel-body {
    padding: 16px;
    border: 1px solid var(--stat-border);
    border-top: 0;
    border-radius: 0 0 5px 5px;
    background-color: #ffffff;
}

.stat-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.stat-panel-row p {
    margin: 0;
    color: var(--stat-text);
    font-size: 13px;
    line-height: 1.45;
}

/* Consistent STAT buttons */
.stat-button {
    display: inline-block;
    min-width: 190px;
    box-sizing: border-box;
    padding: 8px 14px !important;
    border: 1px solid var(--stat-purple-dark) !important;
    border-radius: 5px;
    color: #ffffff !important;
    background-color: var(--stat-purple-medium) !important;
    background-image: none !important;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
}

.stat-button:hover,
.stat-button:focus {
    color: #ffffff !important;
    border-color: #333366 !important;
    background-color: var(--stat-purple-dark) !important;
    background-image: none !important;
}

.stat-button-icon {
    padding-right: 6px;
}

/* STA information */
.stat-info-block {
    margin-bottom: 18px;
}

.stat-info-block:last-child {
    margin-bottom: 0;
}

.stat-info-heading {
    margin: 0 0 7px;
    color: #333366;
    font-size: 14px;
    font-weight: bold;
}

.stat-info-block p {
    margin: 0 0 10px;
    line-height: 1.45;
}

/* Links moved from the shared side navigation */
.stat-resource-links {
    margin: 6px 0 20px;
    padding: 12px 16px;
    border-top: 1px solid var(--stat-border);
    border-bottom: 1px solid var(--stat-border);
    color: var(--stat-text);
    background-color: var(--stat-purple-pale);
    font-size: 12px;
    text-align: center;
}

.stat-resource-label {
    color: #333366;
    font-weight: bold;
}

.stat-resource-links a {
    color: #333366;
    text-decoration: underline;
}

.stat-resource-links a:hover,
.stat-resource-links a:focus {
    color: var(--stat-purple-dark);
}

.stat-link-separator {
    padding: 0 9px;
    color: var(--stat-border);
}

/* Thin footer divider */
.footerBlueSpacer {
    height: 2px !important;
    border: 0;
    background-color: var(--stat-purple);
}

/* Expand and align the shared footer only on this page. */
table[summary="Page Footer"] {
    width: 100% !important;
    table-layout: fixed;
}

table[summary="Page Footer"] > tbody > tr > td {
    padding-left: 32px;
    padding-right: 32px;
    box-sizing: border-box;
}

table[summary="Page Footer"] table {
    width: 100% !important;
    box-sizing: border-box;
}

/* Responsive behavior */
@media (max-width: 700px) {
    #maincontent {
        padding: 14px 16px 22px;
    }

    .stat-auth-option,
    .stat-panel-row {
        display: block;
    }

    .stat-auth-action {
        margin-top: 12px;
        text-align: left;
    }

    .stat-button {
        width: 100%;
    }

    .stat-resource-links a,
    .stat-resource-label {
        display: block;
        margin: 5px 0;
    }

    .stat-link-separator {
        display: none;
    }

    table[summary="Page Footer"] > tbody > tr > td {
        padding-left: 16px;
        padding-right: 16px;
    }
}
