.access-state {
    --state-accent: #1d6654;
    --state-soft: #edf7f3;
    --state-border: #cfe3db;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 1.2rem;
    width: min(720px, 100%);
    margin: clamp(1.25rem, 6vh, 4.5rem) auto;
    padding: clamp(1.35rem, 4vw, 2.3rem);
    border: 1px solid var(--state-border);
    border-radius: 24px;
    background: radial-gradient(circle at 94% 8%, color-mix(in srgb, var(--state-accent) 11%, transparent), transparent 31%), linear-gradient(145deg, #fff, var(--state-soft));
    box-shadow: 0 22px 58px rgba(20, 43, 35, .11);
    color: #172720;
}

.access-state--denied { --state-accent: #a13d4d; --state-soft: #fff1f3; --state-border: #efd1d7; }
.access-state--warning { --state-accent: #9a6818; --state-soft: #fff8e8; --state-border: #ead8ad; }
.access-state--information { --state-accent: #28628e; --state-soft: #edf5fb; --state-border: #cfdfec; }
.access-state--neutral { --state-accent: #53645e; --state-soft: #f3f6f5; --state-border: #dae2df; }

.access-state::after {
    content: "";
    position: absolute;
    right: -78px;
    bottom: -95px;
    width: 220px;
    height: 220px;
    border: 34px solid color-mix(in srgb, var(--state-accent) 7%, transparent);
    border-radius: 50%;
    pointer-events: none;
}

.access-state__icon { position: relative; z-index: 1; display: grid; width: 64px; height: 64px; place-items: center; border-radius: 19px; background: var(--state-accent); color: #fff; box-shadow: 0 12px 26px color-mix(in srgb, var(--state-accent) 24%, transparent); }
.access-state__icon svg { width: 30px; height: 30px; }
.access-state__content { position: relative; z-index: 1; min-width: 0; }
.access-state__eyebrow { margin: 0 0 .4rem; color: var(--state-accent); font-size: .7rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.access-state h1 { max-width: 620px; margin: 0; color: #172720; font-size: clamp(1.45rem, 3vw, 2.15rem); line-height: 1.12; letter-spacing: -.035em; }
.access-state__description { max-width: 610px; margin: .7rem 0 0; color: #617069; font-size: .9rem; line-height: 1.65; }
.access-state__actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.25rem; }
.access-state__actions form { margin: 0; }
.access-state__button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .68rem 1rem; border: 1px solid var(--state-accent); border-radius: 12px; font: inherit; font-size: .76rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.access-state__button--primary { background: var(--state-accent); color: #fff; }
.access-state__button--secondary { background: #fff; color: var(--state-accent); }
.access-state__button:hover, .access-state__button:focus-visible { filter: brightness(.96); outline: 3px solid color-mix(in srgb, var(--state-accent) 24%, transparent); outline-offset: 2px; }

.access-state--compact { grid-template-columns: 42px minmax(0, 1fr); gap: .8rem; width: 100%; margin: 0 0 1rem; padding: .85rem; border-radius: 16px; box-shadow: none; }
.access-state--compact::after { display: none; }
.access-state--compact .access-state__icon { width: 42px; height: 42px; border-radius: 12px; }
.access-state--compact .access-state__icon svg { width: 21px; height: 21px; }
.access-state--compact h1 { font-size: .93rem; letter-spacing: -.01em; }
.access-state--compact .access-state__eyebrow { margin-bottom: .2rem; font-size: .6rem; }
.access-state--compact .access-state__description { margin-top: .28rem; font-size: .72rem; line-height: 1.45; }
.access-state--compact .access-state__actions { margin-top: .7rem; }

.access-state-overlay { position: fixed; inset: 0; z-index: 2147482995; display: grid; place-items: center; padding: 1rem; background: rgba(13, 25, 21, .52); backdrop-filter: blur(5px); }
.access-state-overlay[hidden] { display: none; }
.access-state-overlay .access-state { margin: 0; }
.access-state-overlay__controls { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.1rem; }
.access-state-overlay__code { display: inline-block; margin-top: .6rem; padding: .25rem .48rem; border-radius: 7px; background: rgba(255,255,255,.72); color: #72531f; font: 700 .65rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }

.error-body .access-state { margin: 0; }

@media (max-width: 600px) {
    .access-state { grid-template-columns: 1fr; gap: .9rem; margin: 1rem auto; padding: 1.15rem; border-radius: 18px; }
    .access-state__icon { width: 52px; height: 52px; border-radius: 15px; }
    .access-state__icon svg { width: 25px; height: 25px; }
    .access-state h1 { font-size: 1.4rem; }
    .access-state__actions, .access-state-overlay__controls { align-items: stretch; flex-direction: column; }
    .access-state__actions form, .access-state__button, .access-state-overlay__controls button { width: 100%; }
    .access-state--compact { grid-template-columns: 38px minmax(0, 1fr); padding: .75rem; }
    .access-state--compact .access-state__icon { width: 38px; height: 38px; }
    .access-state--compact h1 { font-size: .88rem; }
}

@media (prefers-reduced-motion: reduce) {
    .access-state__button { scroll-behavior: auto; }
}
