:root {
    --sogefi-gold: #bd9e56;
    --sogefi-gold-light: #d4b978;
    --sogefi-gold-dark: #9a7f45;
    --sogefi-navy: #1e3a5f;
    --sogefi-navy-dark: #152a45;
    --sogefi-text: #333333;
    --sogefi-text-muted: #5a6470;
    --sogefi-bg: #f4f6f9;
    --sogefi-white: #ffffff;
    --sogefi-border: #d8dee8;
    --sogefi-success: #2e7d4f;
    --sogefi-danger: #c0392b;
    --sogefi-info: #3d4f8a;
    --table-bg-color: #e8edf5;
    --table-color: var(--sogefi-navy);
    --shadow-sm: 0 1px 3px rgba(21, 42, 69, 0.08);
    --shadow-md: 0 4px 16px rgba(21, 42, 69, 0.1);
    --radius: 8px;
    --header-height: 64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--sogefi-text);
    background-color: var(--sogefi-bg);
}

a {
    color: var(--sogefi-navy);
    text-decoration-color: var(--sogefi-gold);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--sogefi-gold-dark);
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Header */

.site-header {
    background: linear-gradient(135deg, var(--sogefi-navy-dark) 0%, var(--sogefi-navy) 100%);
    border-bottom: 3px solid var(--sogefi-gold);
    box-shadow: var(--shadow-md);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: 1rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-logo:hover {
    opacity: 0.9;
}

.site-logo__img {
    display: block;
    height: 36px;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: background-color 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a.is-active {
    background-color: rgba(189, 158, 86, 0.2);
    color: var(--sogefi-gold-light);
}

/* Main */

.site-main {
    flex: 1;
    padding: 2rem 0 3rem;
}

.page-title {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    color: var(--sogefi-navy);
}

.page-intro {
    margin: 0 0 1.5rem;
    color: var(--sogefi-text-muted);
}

.card {
    background: var(--sogefi-white);
    border: 1px solid var(--sogefi-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2,
.card h3 {
    color: var(--sogefi-navy);
    margin-top: 0;
}

.section-count {
    font-weight: normal;
    font-size: 0.9em;
    color: var(--sogefi-text-muted);
}

/* Form */

.token-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.token-form label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--sogefi-navy);
    margin-bottom: 0.35rem;
}

.token-form__field {
    flex: 1 1 280px;
}

.token-form input[type="text"] {
    width: 100%;
    max-width: 420px;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--sogefi-border);
    border-radius: var(--radius);
    font-family: "Share Tech Mono", monospace;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.token-form input[type="text"]:focus {
    outline: none;
    border-color: var(--sogefi-gold);
    box-shadow: 0 0 0 3px rgba(189, 158, 86, 0.25);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background-color: var(--sogefi-gold);
    color: var(--sogefi-navy-dark);
}

.btn--primary:hover {
    background-color: var(--sogefi-gold-light);
    color: var(--sogefi-navy-dark);
}

.alert {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.alert--error {
    color: var(--sogefi-danger);
    background: rgba(192, 57, 43, 0.08);
    border: 1px solid rgba(192, 57, 43, 0.25);
}

/* Tables */

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

table tr td,
table tr th {
    padding: 10px 12px 8px;
    border: 1px solid var(--sogefi-border);
    vertical-align: top;
}

table tr th,
table.offre tr td:first-child {
    background-color: var(--table-bg-color);
    color: var(--table-color);
    font-weight: 600;
}

table.offre {
    margin-bottom: 1rem;
}

/* Token card */

.token-card {
    padding: 0;
    overflow: hidden;
}

.token-card__header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.token-card__identicon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius);
    border: 1px solid var(--sogefi-border);
}

.token-card__main {
    flex: 1;
    min-width: 0;
}

.token-card__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sogefi-text-muted);
    margin-bottom: 0.35rem;
}

.token-card__value {
    display: block;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.95rem;
    word-break: break-all;
    padding: 0.65rem 0.85rem;
    background: var(--sogefi-bg);
    border: 1px solid var(--sogefi-border);
    border-radius: var(--radius);
    color: var(--sogefi-navy);
}

.token-card__value--revoked {
    text-decoration: line-through;
    color: var(--sogefi-text-muted);
    opacity: 0.75;
}

.token-card__revoked-date {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--sogefi-danger);
}

.token-card__status {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.token-card__status.ok {
    color: var(--sogefi-success);
    background: rgba(46, 125, 79, 0.1);
}

.token-card__status.expired {
    color: var(--sogefi-danger);
    background: rgba(192, 57, 43, 0.1);
}

.token-card__restrictions {
    border-top: 1px solid var(--sogefi-border);
    padding: 1rem 1.5rem;
    background: var(--sogefi-bg);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.token-restriction {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.token-restriction__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sogefi-navy);
    min-width: 140px;
}

.token-restriction__icon {
    width: 14px;
    height: 14px;
}

.token-restriction__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.token-chip {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.8rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--sogefi-white);
    border: 1px solid var(--sogefi-border);
    color: var(--sogefi-info);
}

@media (max-width: 600px) {
    .token-card__header {
        flex-wrap: wrap;
    }

    .token-card__status {
        margin-left: calc(48px + 1rem);
    }
}

.identicon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: -3px;
}

.token,
.ip,
.referer {
    font-family: "Share Tech Mono", monospace;
}

span.revoked {
    text-decoration: line-through var(--sogefi-danger);
}

p.revoked,
.expired {
    color: var(--sogefi-danger);
}

.ok {
    color: var(--sogefi-success);
}

.l2 {
    margin-left: 0;
    padding-left: 1rem;
    border-left: 3px solid var(--sogefi-gold);
}

.l3 {
    margin-left: 1rem;
}

table.utilisation tr td,
table.utilisation tr td:first-child {
    text-align: center;
    background-color: var(--sogefi-white);
    color: var(--sogefi-text);
}

table.utilisation tr th {
    font-weight: normal;
    font-size: 0.85rem;
}

.service-block {
    border: 1px solid var(--sogefi-border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: var(--sogefi-white);
    overflow: hidden;
}

.service-block:last-child {
    margin-bottom: 0;
}

.service-block[open] {
    box-shadow: var(--shadow-sm);
}

.service-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--sogefi-navy);
    background: var(--table-bg-color);
    user-select: none;
}

.service-summary::-webkit-details-marker {
    display: none;
}

.service-summary::before {
    content: "▸";
    flex-shrink: 0;
    margin-right: 0.5rem;
    color: var(--sogefi-gold-dark);
    transition: transform 0.15s;
}

.service-block[open] > .service-summary::before {
    transform: rotate(90deg);
}

.service-summary__title {
    flex: 1;
    min-width: 0;
}

.service-summary__name {
    font-weight: 600;
}

.service-summary__descr {
    font-weight: normal;
    color: var(--sogefi-text-muted);
}

.service-summary__status {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
}

.service-summary__status.ok {
    color: var(--sogefi-success);
    background: rgba(46, 125, 79, 0.1);
}

.service-summary__status.expired {
    color: var(--sogefi-danger);
    background: rgba(192, 57, 43, 0.1);
}

.service-content {
    padding: 1rem;
    border-top: 1px solid var(--sogefi-border);
}

.service-content .offre {
    margin-bottom: 0;
}

.warning {
    width: 16px;
    height: 16px;
    vertical-align: -2px;
}

.error-page {
    text-align: center;
    padding: 3rem 1rem;
}

.error-page__code {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--sogefi-gold);
    margin: 0 0 0.5rem;
}

.error-page__title {
    font-size: 1.5rem;
    color: var(--sogefi-navy);
    margin: 0 0 1rem;
}

.error-page__text {
    color: var(--sogefi-text-muted);
    margin: 0 0 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.legal-content p {
    color: var(--sogefi-text-muted);
    margin: 0 0 1rem;
}

.legal-content p:last-child {
    margin-bottom: 0;
}

.legal-content__back {
    margin-top: 2rem !important;
}

/* Footer */

.site-footer {
    background: var(--sogefi-navy-dark);
    color: rgba(255, 255, 255, 0.75);
    border-top: 3px solid var(--sogefi-gold);
    margin-top: auto;
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    font-size: 0.875rem;
}

.site-footer__copyright {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}

.site-footer a {
    color: var(--sogefi-gold-light);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--sogefi-white);
    text-decoration: underline;
}

.site-footer__nav {
    display: flex;
    gap: 1.25rem;
}

/* Responsive */

@media (max-width: 600px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 0;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .error-page__code {
        font-size: 3.5rem;
    }
}
