@import url("https://fonts.googleapis.com/css2?family=Spectral:wght@400;500;600;700&display=swap");

body.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 28% 18%, rgba(67, 255, 190, 0.16), transparent 22%),
        radial-gradient(circle at 74% 12%, rgba(255, 157, 72, 0.16), transparent 20%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.58) 78%, rgba(0, 0, 0, 0.88)),
        url("../img/bg-rules.png") center top / cover no-repeat fixed,
        #090909;
    color: #fff;
}

.auth-main {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 50px 0 26px;
}

.auth-card,
.profile-card {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 4vw, 48px);
    clip-path: var(--ragged-edges);
    background:
        linear-gradient(90deg, rgba(63, 255, 185, 0.12), transparent 26%),
        radial-gradient(circle at 84% 18%, rgba(255, 157, 72, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%, rgba(0, 0, 0, 0.34)),
        rgba(8, 10, 11, 0.93);
    border: 1px solid rgba(255, 157, 72, 0.26);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -18px 36px rgba(0, 0, 0, 0.4),
        0 26px 58px rgba(0, 0, 0, 0.55),
        0 0 34px rgba(255, 157, 72, 0.08);
}

.auth-card::before,
.profile-card::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 157, 72, 0.12);
    pointer-events: none;
}

.auth-card::after {
    content: none;
}

.auth-card {
    display: grid;
    grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1fr);
    align-items: center;
    gap: clamp(28px, 5vw, 70px);
}

.auth-card--single {
    grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1fr);
}

.auth-card__intro,
.auth-form-wrap {
    position: relative;
    z-index: 1;
}

.auth-card__intro {
    text-align: left;
}

.auth-card__eyebrow {
    margin: 0 0 10px;
    color: #f7d95e;
    font-family: var(--font-body);
    font-size: 1.04rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: none;
}

.auth-card h1,
.profile-card h1 {
    margin: 0;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(4.5rem, 8vw, 7rem);
    font-weight: 400;
    line-height: 0.8;
    text-shadow: 0 5px 0 #000, 0 18px 28px rgba(0, 0, 0, 0.58);
}

.auth-card__lead,
.auth-switch,
.profile-placeholder,
.profile-panel p,
.profile-panel span {
    font-family: "Spectral", Georgia, serif;
}

.auth-card__lead {
    max-width: 360px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.18rem;
    line-height: 1.22;
}

.auth-feature-list {
    margin: 24px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
    list-style: none;
    font-family: var(--font-body);
}

.auth-feature-list li {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.08rem;
    line-height: 1.18;
    text-shadow: none;
}

.auth-feature-list li::before {
    content: "◆";
    margin-right: 8px;
    color: #ff9d48;
}

.auth-form-wrap {
    padding: 24px;
    clip-path: var(--ragged-edges);
    background:
        radial-gradient(circle at 16% 0%, rgba(63, 255, 185, 0.14), transparent 32%),
        rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.auth-form label {
    display: grid;
    gap: 8px;
    text-align: left;
}

.auth-form span {
    color: #f7d95e;
    font-family: var(--font-body);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: none;
}

.auth-form input {
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    outline: 0;
    clip-path: var(--ragged-edges);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 36%, rgba(0, 0, 0, 0.2)),
        rgba(20, 23, 24, 0.96);
    color: #fff;
    font-family: "Spectral", Georgia, serif;
    font-size: 1.1rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.auth-form input:focus {
    border-color: rgba(63, 255, 185, 0.48);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.35),
        0 0 18px rgba(63, 255, 185, 0.16);
    transform: translateY(-1px);
}

.auth-form button,
.auth-switch a,
.profile-panel a,
.profile-panel button {
    border: 0;
    padding: 13px 18px 11px;
    clip-path: var(--ragged-edges);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 32%, rgba(0, 0, 0, 0.16)),
        #b7722f;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: none;
    cursor: pointer;
    transition: transform 150ms ease, filter 150ms ease;
}

.auth-form button:hover,
.auth-switch a:hover,
.profile-panel a:hover,
.profile-panel button:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
}

.auth-switch {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.82);
}

.auth-errors {
    margin: 0 0 18px;
    padding: 12px;
    background: rgba(255, 75, 75, 0.18);
    border: 1px solid rgba(255, 75, 75, 0.4);
    color: #fff;
    font-family: "Spectral", Georgia, serif;
}

.auth-errors--success {
    background: rgba(35, 126, 34, 0.18);
    border-color: rgba(63, 255, 185, 0.35);
}

.auth-errors p {
    margin: 0;
}

.auth-switch--left {
    justify-content: flex-start;
}

.profile-card {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: clamp(24px, 3.4vw, 40px);
}

.profile-card h1 {
    text-align: center;
}

.profile-card .auth-card__eyebrow {
    text-align: center;
}

.profile-shell {
    position: relative;
    z-index: 1;
    margin-top: 26px;
    padding: clamp(18px, 2.4vw, 28px);
    background:
        radial-gradient(circle at 18% 0%, rgba(63, 255, 185, 0.12), transparent 32%),
        radial-gradient(circle at 88% 10%, rgba(255, 157, 72, 0.1), transparent 30%),
        rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 34px rgba(0, 0, 0, 0.34);
}

.profile-notices {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    margin: 18px auto 0;
    display: grid;
    gap: 8px;
}

.profile-notices p {
    margin: 0;
    padding: 10px 14px 8px;
    clip-path: var(--ragged-edges);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.18;
    text-shadow: none;
}

.profile-notices .is-success {
    background: rgba(35, 126, 34, 0.86);
}

.profile-notices .is-error {
    background: rgba(183, 48, 48, 0.86);
}

.profile-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 150px;
    align-items: center;
    gap: 24px;
    text-align: left;
}

.profile-avatar {
    width: 150px;
    aspect-ratio: 1;
    clip-path: var(--ragged-edges);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border: 1px solid rgba(255, 157, 72, 0.18);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.36), 0 0 24px rgba(63, 255, 185, 0.08);
}

.profile-identity {
    min-width: 0;
}

.profile-panel strong {
    display: inline-block;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    line-height: 0.82;
    text-shadow: 0 3px 0 #000;
}

.profile-panel .profile-identity > strong {
    font-family: var(--font-display);
}

.profile-panel span {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.58);
    font-family: var(--font-body);
}

.profile-panel p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.88);
    overflow-wrap: anywhere;
}

.profile-actions,
.profile-side-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-actions form {
    display: contents;
}

.profile-actions {
    margin-top: 15px;
}

.profile-side-actions {
    justify-content: flex-end;
    align-self: stretch;
    align-content: space-between;
}

.profile-actions button,
.profile-side-actions a,
.profile-side-actions button {
    border: 0;
    padding: 9px 13px 7px;
    clip-path: var(--ragged-edges);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 34%, rgba(0, 0, 0, 0.26)),
        rgba(255, 255, 255, 0.12);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: none;
    cursor: pointer;
    transition: transform 150ms ease, filter 150ms ease;
}

.profile-actions button:hover,
.profile-side-actions a:hover,
.profile-side-actions button:hover {
    transform: translateY(-2px);
    filter: brightness(1.16);
}

.profile-actions .is-danger {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%, rgba(0, 0, 0, 0.24)),
        rgba(183, 48, 48, 0.86);
}

.profile-privileges {
    margin-top: 30px;
    text-align: left;
}

.profile-privileges h2 {
    margin: 0 0 14px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: none;
}

.profile-privileges__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px;
}

.profile-perk {
    position: relative;
    min-height: 154px;
    overflow: hidden;
    border: 1px solid rgba(255, 92, 92, 0.34);
    background: #080909;
    box-shadow: 0 14px 22px rgba(0, 0, 0, 0.34);
    transition: transform 160ms ease, filter 160ms ease;
}

.profile-perk:hover {
    transform: translateY(-4px);
    filter: brightness(1.08);
}

.profile-perk__image {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.03);
}

.profile-perk::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.8));
}

.profile-perk strong,
.profile-perk small {
    position: absolute;
    z-index: 1;
    font-family: var(--font-display);
    text-shadow: 0 2px 0 #000;
}

.profile-perk strong {
    left: 8px;
    top: 8px;
    color: #ff5c5c;
    font-size: 1.05rem;
}

.profile-perk small {
    left: 10px;
    bottom: 8px;
    color: #fff;
    font-size: 0.92rem;
}

.profile-perk.is-expired {
    filter: grayscale(0.4) brightness(0.46);
}

.profile-perk.is-expired small {
    color: #ff5c5c;
}

.profile-empty-perks {
    min-height: 190px;
    padding: clamp(20px, 3vw, 28px);
    display: grid;
    grid-template-columns: 1fr max-content;
    align-items: center;
    gap: 24px;
    clip-path: var(--ragged-edges);
    background:
        radial-gradient(circle at 12% 0%, rgba(63, 255, 185, 0.16), transparent 38%),
        linear-gradient(90deg, rgba(247, 217, 94, 0.1), transparent 34%),
        rgba(6, 8, 9, 0.66);
    border: 1px solid rgba(247, 217, 94, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-empty-perks::before {
    content: "";
    width: 118px;
    aspect-ratio: 1;
    grid-row: 1;
    justify-self: start;
    background: url("../img/favicons/favicon-source.png") center / contain no-repeat;
    filter: drop-shadow(0 0 18px rgba(63, 255, 185, 0.28));
    opacity: 0.72;
}

.profile-empty-perks div {
    grid-column: 1;
    max-width: 520px;
}

.profile-empty-perks strong {
    color: #f7d95e;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 400;
    line-height: 0.9;
    text-shadow: 0 3px 0 #000;
}

.profile-empty-perks p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-family: "Spectral", Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.25;
}

.profile-empty-perks a {
    padding: 12px 16px 10px;
    clip-path: var(--ragged-edges);
    background: #b7722f;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.18rem;
    text-shadow: 0 2px 0 #000;
    transition: transform 150ms ease, filter 150ms ease;
}

.profile-empty-perks a:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 18%, rgba(63, 255, 185, 0.12), transparent 28%),
        rgba(0, 0, 0, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.profile-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.profile-modal__window {
    position: relative;
    width: min(520px, 100%);
    padding: clamp(24px, 4vw, 36px);
    clip-path: var(--ragged-edges);
    background:
        radial-gradient(circle at 18% 0%, rgba(63, 255, 185, 0.16), transparent 34%),
        radial-gradient(circle at 86% 8%, rgba(255, 157, 72, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%, rgba(0, 0, 0, 0.32)),
        rgba(9, 11, 12, 0.96);
    border: 1px solid rgba(255, 157, 72, 0.24);
    box-shadow: 0 28px 58px rgba(0, 0, 0, 0.6);
    transform: translateY(14px) scale(0.97);
    transition: transform 180ms ease;
}

.profile-modal.is-open .profile-modal__window {
    transform: translateY(0) scale(1);
}

.profile-modal__close {
    position: absolute;
    right: 18px;
    top: 14px;
    border: 0;
    background: transparent;
    color: #fff;
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 2px 0 #000;
}

.profile-modal__window h2 {
    margin: 0 0 20px;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.6rem);
    font-weight: 400;
    line-height: 0.78;
    text-shadow: 0 4px 0 #000;
}

.profile-modal-form {
    display: grid;
    gap: 14px;
}

.profile-modal-form label {
    display: grid;
    gap: 8px;
}

.profile-modal-form span {
    color: #f7d95e;
    font-family: var(--font-body);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: none;
}

.profile-modal-form input {
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: 0;
    clip-path: var(--ragged-edges);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 34%, rgba(0, 0, 0, 0.22)),
        rgba(17, 18, 19, 0.94);
    color: #fff;
    font-family: "Spectral", Georgia, serif;
    font-size: 1rem;
}

.profile-modal-form input:focus {
    border-color: rgba(63, 255, 185, 0.44);
    box-shadow: 0 0 18px rgba(63, 255, 185, 0.12);
}

.profile-modal-form p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-family: "Spectral", Georgia, serif;
    line-height: 1.25;
}

.profile-modal-form button {
    margin-top: 4px;
    border: 0;
    padding: 13px 18px 11px;
    clip-path: var(--ragged-edges);
    background: #b7722f;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: none;
    cursor: pointer;
    transition: transform 150ms ease, filter 150ms ease;
}

.profile-modal-form button:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
}

@media (max-width: 820px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-card__intro {
        text-align: center;
    }

    .auth-card__lead {
        margin-left: auto;
        margin-right: auto;
    }

    .profile-panel {
        grid-template-columns: 130px 1fr;
    }

    .profile-avatar {
        width: 130px;
    }

    .profile-side-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .profile-privileges__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .auth-main {
        width: min(100% - 28px, 1120px);
    }

    .auth-form-wrap {
        padding: 18px;
    }

    .auth-switch,
    .profile-panel {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }

    .auth-switch {
        flex-direction: column;
    }

    .profile-side-actions,
    .profile-actions {
        justify-content: center;
    }

    .profile-privileges__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-avatar {
        width: 150px;
    }

    .profile-empty-perks {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-empty-perks::before {
        justify-self: center;
    }
}
