html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: #d9d9d9;
    color: #f7f8fb;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.portal-shell {
    width: min(1080px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.portal-panel,
.portal-dashboard {
    position: relative;
    width: 100%;
    background: #0a102d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.portal-panel {
    max-width: 440px;
    padding: 36px;
}

.portal-dashboard {
    padding: 28px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.brand-block.compact {
    margin-bottom: 0;
}

.brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
}

.brand-logo.small {
    width: 48px;
    height: 48px;
}

.brand-block h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 650;
}

.brand-block p {
    margin: 4px 0 0;
    color: #c7cce0;
}

.portal-form {
    display: grid;
    gap: 16px;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #3355aa;
    background: #050814;
    color: #ffffff;
}

.form-control:focus {
    border-color: #6d8bff;
    background: #080f2b;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(109, 139, 255, 0.25);
}

.form-floating > label {
    color: #c7cce0;
}

.btn-portal {
    min-height: 48px;
    border-radius: 8px;
    background: #2458d3;
    border-color: #2458d3;
    font-weight: 600;
}

.btn-portal:hover {
    background: #1d49b1;
    border-color: #1d49b1;
}

.language-link {
    border: 0;
    background: transparent;
    color: #9fe3b1;
    padding: 0;
    font: inherit;
    font-size: 0.9rem;
    text-decoration: none;
}

.portal-panel > .language-link {
    position: absolute;
    top: 14px;
    right: 16px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.summary-item {
    background: #111a42;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px;
}

.summary-item span {
    display: block;
    color: #aeb7db;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 6px;
}

.summary-item strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 1rem;
}

.keys-section,
.renewal-section {
    background: #050814;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 16px;
}

.renewal-section {
    margin-bottom: 24px;
}

.renewal-plans {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.renewal-card {
    display: grid;
    gap: 10px;
    align-content: space-between;
    background: #0c1333;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px;
}

.renewal-card h3 {
    margin: 0;
    font-size: 1rem;
}

.renewal-price {
    color: #9fe3b1;
    font-size: 1.45rem;
    font-weight: 700;
}

.renewal-message {
    min-height: 22px;
    margin-bottom: 12px;
    color: #c7cce0;
    font-size: 0.92rem;
}

.renewal-message.error {
    color: #ff8a8a;
}

.renewal-message.success {
    color: #9fe3b1;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
    font-size: 1.1rem;
}

.section-title span {
    color: #aeb7db;
    font-size: 0.9rem;
}

.key-list {
    display: grid;
    gap: 12px;
}

.key-row {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    background: #0c1333;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.key-meta {
    color: #dce2ff;
    min-width: 0;
}

.key-meta strong,
.key-meta span {
    display: block;
    overflow-wrap: anywhere;
}

.key-meta span {
    color: #aeb7db;
    font-size: 0.86rem;
}

.key-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9fe3b1;
    background: #02040c;
    border: 1px solid rgba(159, 227, 177, 0.18);
    border-radius: 6px;
    padding: 10px;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", monospace;
    font-size: 0.86rem;
}

.empty-state {
    color: #aeb7db;
    text-align: center;
    padding: 28px 12px;
}

@media (max-width: 760px) {
    .portal-shell {
        width: min(100% - 20px, 1080px);
        align-items: flex-start;
        padding-top: 16px;
    }

    .portal-shell:has(.portal-dashboard.d-none) {
        align-items: flex-start;
        padding-top: 25vh;
        padding-bottom: 0;
    }

    .portal-panel,
    .portal-dashboard {
        padding: 14px;
    }

    .dashboard-header,
    .brand-block {
        align-items: flex-start;
    }

    .dashboard-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 12px;
    }

    .dashboard-header .btn {
        flex: 0 0 auto;
    }

    .dashboard-actions {
        gap: 10px;
    }

    .brand-logo.small {
        width: 36px;
        height: 36px;
    }

    .brand-block {
        gap: 10px;
        margin-bottom: 14px;
    }

    .brand-block h1 {
        font-size: 1.25rem;
    }

    .brand-block p {
        font-size: 0.82rem;
        margin-top: 1px;
    }

    .customer-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 12px;
    }

    .summary-item {
        padding: 8px 10px;
        min-width: 0;
    }

    .summary-item span {
        font-size: 0.66rem;
        margin-bottom: 2px;
    }

    .summary-item strong {
        font-size: 0.88rem;
        line-height: 1.2;
    }

    .summary-item:first-child {
        grid-column: 1 / -1;
    }

    .keys-section,
    .renewal-section {
        padding: 12px;
    }

    .renewal-section {
        margin-bottom: 12px;
    }

    .renewal-plans {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .renewal-card {
        padding: 10px;
    }

    .renewal-price {
        font-size: 1.2rem;
    }

    .key-row {
        grid-template-columns: 1fr;
    }

    .key-value {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        white-space: normal;
        overflow: hidden;
    }
}
