/* ATH License Portal — global styles */

:root {
    /* Alias portal variables to brand tokens defined in ath-brand.css */
    --ath-primary:  var(--ath-navy);
    --ath-accent:   var(--ath-orange);
    --ath-bg:       var(--ath-content-bg, #f4f6fb);
    --ath-nav-bg:   var(--ath-navy);
    --ath-nav-text: rgba(255, 255, 255, 0.82);
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    background: var(--ath-bg);
    margin: 0;
    height: 100%;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.portal-layout {
    display: flex;
    height: 100vh;
}

.portal-nav {
    width: 220px;
    min-width: 220px;
    background: var(--ath-nav-bg);
    color: var(--ath-nav-text);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.portal-nav-header {
    padding: 14px 16px 14px;
    background-color: #ffffff;
    border-bottom: 2px solid var(--ath-orange, #F26522);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}

.portal-brand {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
}

.portal-nav-links {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    flex: 1;
}

.portal-nav-links li a,
.portal-nav-links li .nav-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    color: var(--ath-nav-text);
    text-decoration: none;
    transition: background 0.15s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 13.5px;
}

.portal-nav-links li a:hover,
.portal-nav-links li .nav-logout-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.portal-nav-links li a.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.nav-section-label {
    padding: 12px 18px 4px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #607080;
    pointer-events: none;
}

.nav-divider {
    border-top: 1px solid #2e3d55;
    margin: 8px 0;
}

/* ── Main content ────────────────────────────────────────────────────────── */
.portal-main {
    flex: 1;
    overflow-y: auto;
}

.portal-content {
    padding: 28px 32px;
    max-width: 1400px;
}

/* ── Page chrome ─────────────────────────────────────────────────────────── */
.portal-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ath-primary);
    margin: 0 0 20px;
}

.portal-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.portal-page-header .portal-page-title {
    margin: 0;
}

/* ── Dashboard cards ─────────────────────────────────────────────────────── */
.portal-dashboard-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.portal-stat-card {
    background: #fff;
    border: 1px solid #dde3ef;
    border-radius: 8px;
    padding: 24px 32px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--ath-primary);
}

.stat-label {
    font-size: 0.82rem;
    color: #607080;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ── Wizard ──────────────────────────────────────────────────────────────── */

/* Card wrapper that lifts the wizard off the page background */
.wizard-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(34, 55, 115, 0.12), 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #dde3ef;
    overflow: hidden;
    max-width: 980px;
}

/* Telerik renders a white background on the wizard host element; match the card */
.wizard-card .k-wizard {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.wizard-step-content {
    padding: 24px 20px;
    min-height: 360px;
}

.feature-row {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid #eaecf0;
}

.feature-label {
    margin-left: 8px;
    font-size: 0.95rem;
}

/* Attribute container under an expanded feature */
.attrib-section {
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Numeric attributes — up to 2 per row */
.attrib-grid-numeric {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px 24px;
    margin-bottom: 10px;
}

.attrib-numeric-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Boolean attributes — 3 per row */
.attrib-grid-bool {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 12px;
}

.attrib-bool-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;        /* allow grid cells to shrink */
}

.attrib-label-bool {
    font-size: 0.84rem;
    color: #4a5568;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attrib-auto-hint {
    font-size: 0.74rem;
    color: #607080;
    font-style: italic;
    font-weight: 400;
    margin-left: 6px;
}

/* Version selection — newer version available notice */
.version-warning-banner {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #7a5c00;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 0.82rem;
}

/* Legacy single-row attribute (Edit.razor uses this) */
.attrib-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    padding: 4px 0;
}

.attrib-label {
    min-width: 220px;
    font-size: 0.87rem;
    color: #4a5568;
}

/* ── Detail table ────────────────────────────────────────────────────────── */
.detail-table td {
    padding: 8px 16px;
}

.detail-table td:first-child {
    color: #607080;
    width: 160px;
    font-weight: 500;
}

.review-table td {
    padding: 6px 16px;
    border-bottom: 1px solid #eaecf0;
}

.review-table td:first-child {
    color: #607080;
    width: 140px;
}

/* ── Action bar ──────────────────────────────────────────────────────────── */
.action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.ms-2 { margin-left: 8px; }
.ms-4 { margin-left: 18px; }
.fst-italic { font-style: italic; }
.text-muted  { color: #607080; }
.text-danger { color: #d32f2f; }

.alert-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #c62828;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.87rem;
}

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.status-draft     { background: #e8eaf6; color: #3949ab; }
.status-issued    { background: #e3f2fd; color: #0277bd; }
.status-active    { background: #e8f5e9; color: #2e7d32; }
.status-suspended { background: #fff8e1; color: #f57f17; }
.status-revoked   { background: #fce4ec; color: #c62828; }
.status-cancelled { background: #fce4ec; color: #c62828; }
.status-expired   { background: #f5f5f5; color: #616161; }

/* ── Headings — suppress Blazor circuit focus ring ───────────────────────── */
/* Blazor Server adds tabindex="-1" to <h1> on circuit connect for a11y nav.
   The browser then shows a focus outline. Headings are non-interactive so
   the outline is misleading — suppress it. */
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus {
    outline: none;
}

/* ── Grid — no cell wrapping ─────────────────────────────────────────────── */
.k-grid .k-table-td,
.k-grid .k-table-th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f1a33 0%, var(--ath-navy) 100%);
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 44px 48px 40px;
    width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand-logo {
    margin-bottom: 10px;
}

.login-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ath-primary);
    margin: 0 0 6px;
}

.login-logo {
    max-height: 64px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.login-copyright {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid #eaecef;
    text-align: center;
    font-size: 0.78rem;
    color: #607080;
}

.login-copyright a {
    color: var(--ath-accent);
    text-decoration: none;
    font-weight: 500;
}

.login-copyright a:hover {
    text-decoration: underline;
}

.login-error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #c62828;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.87rem;
}

.login-field {
    margin-bottom: 18px;
}

.login-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.login-remember-label {
    font-size: 0.87rem;
    color: #4a5568;
    cursor: pointer;
}

.login-submit {
    text-align: center;
}

.login-btn {
    width: 100%;
}
