/**
 * web_access.css
 * The login / premium dialogs of the website's free tier (static/js/web_access.js). They stand above every painted
 * screen (the reader, the clock, the hub, the collections dialogs), so the z-index is the highest of the site's own layers.
 */

.aa-layer {
    --aa-u: 1;
    --aa-gold: #ffd700;
    --aa-gold-warm: #ffd98a;
    --aa-cream: #f3e9d2;
    --aa-cream-soft: rgba(243, 233, 210, 0.82);
    --aa-hairline: rgba(255, 210, 122, 0.34);
    --aa-serif: 'Baskerville', 'Baskervville', 'Libre Baskerville', 'Hoefler Text', Georgia, 'Times New Roman', serif;
    position: fixed;
    inset: 0;
    z-index: 12500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.aa-layer[hidden] {
    display: none;
}

.aa-layer.is-open {
    opacity: 1;
}

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

.aa-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 3, 0.68);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.aa-dialog {
    position: relative;
    width: min(calc(440px * var(--aa-u)), 100%);
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(30px * var(--aa-u)) calc(26px * var(--aa-u)) calc(26px * var(--aa-u));
    border-radius: calc(22px * var(--aa-u));
    background: linear-gradient(165deg, rgba(27, 22, 12, 0.97), rgba(8, 10, 7, 0.98));
    border: 1px solid var(--aa-hairline);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 44px rgba(255, 200, 80, 0.08);
    text-align: center;
    color: var(--aa-cream);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    outline: none;
}

.aa-layer.is-open .aa-dialog {
    transform: none;
}

.aa-medal {
    flex: none;
    width: calc(64px * var(--aa-u));
    height: calc(64px * var(--aa-u));
    margin: 0 0 calc(16px * var(--aa-u));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.5);
    color: var(--aa-gold-warm);
}

.aa-medal svg {
    width: calc(28px * var(--aa-u));
    height: calc(28px * var(--aa-u));
}

/* the site styles its headings with a glowing animation: this one stays still */
.aa-dialog .aa-title {
    margin: 0;
    padding: 0;
    font-family: var(--aa-serif);
    font-weight: 400;
    font-size: calc(23px * var(--aa-u));
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    text-shadow: none;
    animation: none;
    background: none;
    color: var(--aa-cream);
    -webkit-text-fill-color: currentColor;
    text-wrap: balance;
}

.aa-dialog .aa-text,
.aa-dialog .aa-sub {
    margin: 0;
    font-family: var(--aa-serif);
    text-shadow: none;
    animation: none;
}

.aa-dialog .aa-text {
    margin-top: calc(10px * var(--aa-u));
    font-style: italic;
    font-size: calc(16.5px * var(--aa-u));
    line-height: 1.45;
    color: var(--aa-cream-soft);
}

.aa-dialog .aa-sub {
    margin-top: calc(12px * var(--aa-u));
    font-size: calc(14.5px * var(--aa-u));
    line-height: 1.5;
    color: rgba(243, 233, 210, 0.66);
}

.aa-dialog .aa-sub[hidden] {
    display: none;
}

.aa-actions {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: calc(10px * var(--aa-u));
    margin-top: calc(22px * var(--aa-u));
}

.aa-dialog .aa-pill {
    min-height: calc(48px * var(--aa-u));
    margin: 0;
    padding: 0 calc(22px * var(--aa-u));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(24px * var(--aa-u));
    background: rgba(10, 10, 7, 0.82);
    border: 1px solid rgba(255, 210, 122, 0.5);
    font-family: var(--aa-serif);
    font-size: calc(16.5px * var(--aa-u));
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    text-shadow: none;
    box-shadow: none;
    color: var(--aa-cream);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.aa-dialog .aa-pill--gold {
    border-color: transparent;
    background: linear-gradient(135deg, #ffe08a, #f5b83d);
    font-weight: 700;
    color: #1f1606;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

@media (hover: hover) {
    .aa-dialog .aa-pill:hover {
        border-color: rgba(255, 215, 0, 0.85);
    }

    .aa-dialog .aa-pill--gold:hover {
        background: linear-gradient(135deg, #ffe898, #f8c04a);
    }
}

.aa-dialog .aa-pill:active {
    transform: scale(0.985);
}

.aa-dialog .aa-close {
    position: absolute;
    top: calc(12px * var(--aa-u));
    right: calc(12px * var(--aa-u));
    width: calc(38px * var(--aa-u));
    height: calc(38px * var(--aa-u));
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 217, 138, 0.72);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.aa-dialog .aa-close svg {
    width: calc(18px * var(--aa-u));
    height: calc(18px * var(--aa-u));
}

@media (hover: hover) {
    .aa-dialog .aa-close:hover {
        border-color: var(--aa-hairline);
        color: var(--aa-gold);
    }
}

.aa-dialog .aa-pill:focus-visible,
.aa-dialog .aa-close:focus-visible {
    outline: 2px solid #ffe08a;
    outline-offset: 2px;
}

@media (min-width: 1200px) {
    .aa-layer {
        --aa-u: 1.12;
    }
}

@media (max-width: 380px) {
    .aa-dialog {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* a phone on its side: the dialog is short, so the medal makes way and the buttons stand side by side in a wider card */
@media (max-height: 520px) {
    .aa-medal {
        display: none;
    }

    .aa-dialog {
        width: min(calc(560px * var(--aa-u)), 100%);
        padding-top: 22px;
        padding-bottom: 18px;
    }

    .aa-actions {
        flex-direction: row;
        margin-top: 16px;
    }

    .aa-actions .aa-pill {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aa-layer,
    .aa-dialog,
    .aa-dialog .aa-pill {
        transition: none;
    }
}
