@import url('https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* User Logins type scale: change these tokens to tune the module. */
:root {
    --syllables-font-ui: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
    --identity-type-display: 2rem;
    --identity-type-title: 1.625rem;
    --identity-type-section: 1.125rem;
    --identity-type-body: .875rem;
    --identity-type-support: .8125rem;
    --identity-type-meta: .75rem;
    --identity-type-leading: 1.45;
}
html, body { font-family: var(--syllables-font-ui); }
button, input, select, textarea { font-family: inherit; }
body { font-size: var(--identity-type-body); line-height: var(--identity-type-leading); }

.page-heading h1, .login-page .login-card h2, .first-password-page .first-password-card h1,
.shared-access-hero h1, .ib-heading h1 {
    font-size: var(--identity-type-title);
    line-height: 1.2;
}
.identity-hero-copy h2, .login-page .login-message h1, .hero-copy h2 {
    font-size: var(--identity-type-display);
}
.panel header h3, .form-section > header h3, .managed-user-card h2,
.profile-summary h2, .ib-card-heading h2, .ib-preview-heading h2 {
    font-size: var(--identity-type-section);
    line-height: 1.3;
}
.page-heading p, .panel header p, .form-section > header p, .managed-user-card > p,
.profile-summary > p, .table-user small, .table-sub, .shared-main small,
.managed-details dt, .form-grid label small, .create-grid small, .create-fields small,
.permission-card small, .login-page .login-note, .login-page .login-options,
.login-page .login-card .muted, .first-password-page .first-password-card > p,
.shared-permission-grid small, .individual-required-card span, .former-student-pages,
.ib-card-heading p, .ib-help {
    font-size: var(--identity-type-support);
}
.shared-meta small, .status-pill, .status-badge, .breadcrumbs, .footer,
.footer strong, .sidebar-profile-copy span, .sidebar-profile-copy small,
.sidebar-module-label, .login-page .eyebrow, .limited-badge {
    font-size: var(--identity-type-meta);
}
.nav a, .sidebar-profile-copy strong, .sidebar-footer a, .panel header a,
.heading-actions a, .primary-btn.compact, .primary-link-btn,
.form-grid label, .create-grid label, .create-fields label, .permission-card strong,
.shared-main strong, .shared-meta span, .managed-details dd, .empty-shared strong,
.shared-warning strong, .shared-warning span, .success-banner, .error-banner,
.login-page .login-card > label, .login-page .login-card .alert, .login-page .login-message > p,
.first-password-page .first-password-card label, .first-password-page .first-password-card button,
.shared-access-hero > p, .shared-access-notice, .shared-permission-grid strong,
.individual-required-card strong, .shared-access-top > a {
    font-size: var(--identity-type-body);
}
.identity-membership-form label > span { font-size: var(--identity-type-body) !important; }
.app-shell :is(input:not([type=checkbox],[type=radio],[type=range],[type=color]), select, textarea),
.login-page .login-card :is(input:not([type=checkbox]), button.primary-btn),
.first-password-page .first-password-card input, .ib-page .ib-button {
    font-size: var(--identity-type-body);
}
.identity-table thead th, .identity-table tbody td {
    font-size: var(--identity-type-body);
    line-height: var(--identity-type-leading);
    vertical-align: middle;
}
.identity-table thead th {
    font-weight: 600;
    letter-spacing: normal;
    color: var(--heading, var(--text));
}
.identity-table tbody td { font-weight: 400; }
.identity-table :is(.table-user strong, .student-name), .shared-main strong {
    font-size: var(--identity-type-body);
    font-weight: 500;
    color: var(--heading, var(--text));
}
.empty-shared span { font-size: var(--identity-type-support); }

/* Keep a column for the status alongside the group details on wide screens. */
.shared-panel .shared-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, .65fr) minmax(0, .5fr) auto;
}
.shared-panel .shared-row-with-institution {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, .8fr) minmax(0, .65fr) minmax(0, .5fr) auto;
}
.shared-panel :is(.shared-main, .shared-meta) { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 950px) {
    .shared-panel .shared-row { grid-template-columns: auto minmax(0, 1fr) auto; }
}

.identity-personal-page .hero h1, .identity-restricted-page .hero h1 { font-size: var(--identity-type-title); }
.identity-personal-page .card h3 { font-size: var(--identity-type-section); }
.identity-restricted-page :is(.lead, .info p, .actions .btn),
.shared-edit-fields label, .shared-manage-permissions strong, .shared-side-actions button,
.ib-page :is(input, select, textarea, label) { font-size: var(--identity-type-body); }
.identity-restricted-page .note, .shared-overview small, .shared-password-reveal p,
.shared-manage-permissions small { font-size: var(--identity-type-support); }
.identity-table-pagination :is(.pagination-summary, input, select, button, .pagination-ellipsis) {
    font-size: var(--identity-type-support) !important;
}

/* Relationships has legacy inline styles loaded after the shared stylesheet.
   Match their components here with enough specificity to use the shared scale. */
:root :is(.relationship-builder, .relationship-list-panel) header h3,
:root .relationship-dialog-head h3,
:root .relationship-summary-grid strong {
    font-size: var(--identity-type-section);
}
:root :is(.relationship-builder, .relationship-list-panel) header p,
:root .relationship-summary-grid small,
:root .relationship-form .relationship-primary-check,
:root .relationship-table .person-meta,
:root .relationship-dialog-head p,
:root .relationship-edit-form .permission-option small {
    font-size: var(--identity-type-support);
}
:root .relationship-form label,
:root .relationship-form select,
:root .relationship-form .primary-btn,
:root .relationship-table :is(th, td, .person-name),
:root .relationship-edit-form > label,
:root .relationship-edit-form .permission-option strong,
:root .relationship-dialog-actions :is(.primary-btn, .outline-btn) {
    font-size: var(--identity-type-body);
    line-height: var(--identity-type-leading);
}
:root .relationship-table th {
    color: var(--heading);
    font-weight: 600;
    letter-spacing: normal;
}
:root .relationship-table .relationship-badge {
    font-size: var(--identity-type-meta);
}

/* Identity dashboard cards. */
.stats-grid-two .stat-copy > span,
.dashboard-grid .foundation-list strong,
.dashboard-grid .snapshot :is(dt, dd) {
    font-size: var(--identity-type-body);
}
.stats-grid-two .stat-copy > small,
.dashboard-grid .foundation-list small {
    font-size: var(--identity-type-support);
}
.stats-grid-two .stat-card .stat-copy > strong {
    font-size: var(--identity-type-title);
    line-height: 1.2;
}
.dashboard-grid .snapshot dd {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Keep Profile snapshot sized to its own content in the dashboard grid. */
.dashboard-grid > .panel:has(> .snapshot) {
    align-self: start;
    min-width: 0;
    container-type: inline-size;
}
.dashboard-grid > .panel:has(> .snapshot) > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .75rem;
    padding: 1rem 1.125rem;
    height: auto;
}
.dashboard-grid > .panel:has(> .snapshot) > header p {
    margin-top: .25rem;
    line-height: 1.45;
}
.dashboard-grid > .panel:has(> .snapshot) > header a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: .125rem .625rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    font-weight: 600;
    white-space: nowrap;
}
.dashboard-grid .snapshot {
    padding: .25rem 1.125rem .625rem;
}
.dashboard-grid .snapshot > div {
    display: grid;
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr);
    align-items: baseline;
    gap: .25rem .75rem;
    padding: .625rem 0;
}
.dashboard-grid .snapshot dd {
    text-align: left;
    overflow-wrap: anywhere;
}
@container (max-width: 21rem) {
    .dashboard-grid .snapshot > div {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Match the Profile snapshot header and keep account details compact. */
.dashboard-grid > .identity-foundation {
    align-self: start;
    min-width: 0;
}
.dashboard-grid > .identity-foundation > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .75rem;
    padding: 1rem 1.125rem;
}
.identity-foundation > header p { margin-top: .25rem; }
.identity-foundation > header .status-badge {
    border-radius: 1rem;
    padding: .25rem .625rem;
}
.identity-foundation .foundation-list {
    padding: .25rem 1.125rem .625rem;
}
.identity-foundation .foundation-list > div {
    align-items: start;
    gap: .75rem;
    padding: .625rem 0;
}
.identity-foundation .foundation-list span {
    width: 1.75rem;
    height: 1.75rem;
    font-size: .75rem;
    background: color-mix(in srgb, var(--purple) 14%, var(--panel));
    color: var(--heading);
}
.identity-foundation .foundation-list small { margin-top: .125rem; }
