body.auth-modal-open {
    overflow: hidden;
}

.auth-gate[hidden],
.auth-form[hidden],
.auth-account[hidden],
.auth-message[hidden] {
    display: none !important;
}

.auth-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(520px, 1fr);
    overflow-y: auto;
    background: #f8f9f5;
}

.auth-gate-backdrop {
    position: relative;
    align-self: stretch;
    min-height: 100dvh;
    overflow: hidden;
    background-color: #182016;
    background-image: url("../auth-archive-room.png");
    background-position: center;
    background-size: cover;
}

.auth-gate-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 7, 0.43);
}

.auth-gate-backdrop::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.14);
}

.auth-showcase {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100dvh;
    flex-direction: column;
    padding: clamp(46px, 6vw, 88px) clamp(42px, 6.5vw, 102px) clamp(42px, 5vw, 72px);
}

.auth-showcase-copy {
    max-width: 580px;
    margin-top: clamp(148px, 25vh, 250px);
}

.auth-showcase-copy p {
    margin: 0 0 29px;
    color: #a9bd73;
    font-size: clamp(12px, 1vw, 16px);
    font-weight: 750;
    letter-spacing: -0.015em;
}

.auth-showcase-copy h1 {
    margin: 0;
    color: #fff;
    font-family: "NanumMyeongjo", "Nanum Myeongjo", "Noto Serif KR", Batang, serif;
    font-size: clamp(35px, 3.15vw, 55px);
    font-weight: 700;
    line-height: 1.34;
    letter-spacing: -0.055em;
    text-wrap: balance;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.32);
}

.auth-showcase-copy > span {
    display: block;
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(13px, 1.05vw, 17px);
    line-height: 1.75;
    letter-spacing: -0.02em;
}

.auth-showcase-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 520px);
    margin-top: auto;
}

.auth-showcase-features > span {
    display: grid;
    min-width: 0;
    gap: 12px;
    place-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.24);
    color: #fff;
    text-align: center;
}

.auth-showcase-features > span:first-child {
    border-left: 0;
}

.auth-showcase-features .icon {
    width: 27px;
    height: 27px;
    color: #a8bd6d;
    stroke-width: 1.45;
}

.auth-showcase-features b {
    overflow: hidden;
    font-size: clamp(11px, 0.9vw, 14px);
    font-weight: 650;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-dialog {
    position: relative;
    align-self: center;
    justify-self: center;
    width: min(calc(100% - 72px), 520px);
    max-height: 100dvh;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
}

.auth-brand {
    display: flex;
    align-items: center;
    padding: 26px 36px 18px;
    border-bottom: 0;
    background: transparent;
}

.auth-brand .auth-brand-logo {
    display: block;
    width: min(100%, 206px);
    height: auto;
    aspect-ratio: 462 / 96;
    object-fit: contain;
    object-position: left center;
}

[data-auth-forms] {
    padding: 30px 36px 32px;
}

.auth-heading {
    margin-bottom: 24px;
    text-align: center;
}

.auth-heading p {
    margin: 0 0 8px;
    color: #78924d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.auth-heading h2 {
    margin: 0;
    color: #253020;
    font-size: clamp(22px, 4vw, 27px);
    line-height: 1.3;
    letter-spacing: -0.04em;
}

.auth-heading > span {
    display: block;
    margin-top: 9px;
    color: #788273;
    font-size: 13px;
    line-height: 1.6;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 22px;
    padding: 4px;
    border-radius: 12px;
    background: #edf0e9;
}

.auth-tabs button {
    min-height: 40px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #71796c;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.auth-tabs button[aria-selected="true"] {
    background: #fff;
    color: #34432c;
    box-shadow: 0 2px 8px rgba(41, 54, 33, 0.08);
}

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

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

.auth-form label > span {
    color: #4c5547;
    font-size: 12px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    height: 46px;
    box-sizing: border-box;
    border: 1px solid #d9ded4;
    border-radius: 11px;
    background: #fff;
    color: #273023;
    padding: 0 14px;
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-form input::placeholder {
    color: #a6ada1;
}

.auth-form input:focus {
    border-color: #78934c;
    box-shadow: 0 0 0 3px rgba(120, 147, 76, 0.14);
}

.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-primary-button,
.auth-guest-button,
.auth-logout-button {
    width: 100%;
    min-height: 47px;
    border-radius: 11px;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.auth-primary-button {
    border: 1px solid #607c37;
    background: #6f8b46;
    color: #fff;
    box-shadow: 0 8px 22px rgba(87, 111, 52, 0.18);
}

.auth-primary-button:hover {
    background: #617c3b;
}

.auth-guest-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #d7ddd2;
    background: #fff;
    color: #475440;
}

.auth-guest-button:hover {
    border-color: #aebba4;
    background: #f5f7f2;
}

.auth-guest-button .icon,
.auth-role-note .icon {
    width: 17px;
    height: 17px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #a0a79b;
    font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e3e7df;
}

.auth-history-note,
.auth-role-note {
    margin: 10px 0 0;
    color: #7c8577;
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

.auth-role-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: -2px 0 0;
    color: #637a45;
}

.auth-message {
    margin: -2px 0 0;
    border-radius: 9px;
    background: #fff0ee;
    color: #aa4036;
    padding: 9px 11px;
    font-size: 12px;
    line-height: 1.45;
}

.auth-message.is-success {
    background: #edf7e7;
    color: #4d7131;
}

.auth-account {
    position: relative;
    padding: 42px 36px 36px;
    text-align: center;
}

.auth-close-button {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #697263;
    cursor: pointer;
}

.auth-close-button:hover {
    background: #edf0e9;
}

.auth-account-avatar {
    display: grid;
    width: 70px;
    height: 70px;
    margin: 0 auto 17px;
    place-items: center;
    border-radius: 22px;
    background: #e9efe1;
    color: #698343;
}

.auth-account-avatar .icon {
    width: 30px;
    height: 30px;
}

.auth-account p {
    margin: 0 0 5px;
    color: #899183;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-account h2 {
    margin: 0;
    color: #283323;
    font-size: 25px;
}

.auth-account-id {
    display: block;
    margin-top: 5px;
    color: #7c8477;
    font-size: 13px;
}

.auth-role-badge {
    display: inline-flex;
    margin: 15px 0 26px;
    border-radius: 999px;
    background: #edf2e7;
    color: #617941;
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 800;
}

.auth-logout-button {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: #7f8879;
}

.auth-logout-button:hover {
    color: #af443d;
}

@media (max-width: 940px) {
    .auth-gate {
        display: flex;
        flex-direction: column;
        background: #fbfcf8;
    }

    .auth-gate-backdrop {
        order: 2;
        min-height: 300px;
    }

    .auth-dialog {
        order: 1;
        width: 100%;
        min-height: 100dvh;
        max-height: none;
        background: #fbfcf8;
        border-radius: 0;
    }

    [data-auth-forms],
    .auth-account {
        padding-right: 22px;
        padding-left: 22px;
    }

    .auth-brand {
        padding-top: 24px;
        padding-right: 22px;
        padding-left: 22px;
    }

    .auth-heading {
        margin-top: clamp(12px, 5vh, 44px);
    }

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

    .auth-showcase {
        min-height: 300px;
        padding: 35px 42px;
    }

    .auth-showcase-copy {
        margin-top: 0;
    }

    .auth-showcase-copy p {
        margin-bottom: 12px;
    }

    .auth-showcase-copy h1 {
        font-size: 30px;
        line-height: 1.32;
    }

    .auth-showcase-copy > span {
        display: none;
    }

    .auth-showcase-features {
        max-width: 390px;
    }
}

@media (max-width: 560px) {
    .auth-gate-backdrop {
        display: none;
    }

    [data-auth-forms] {
        padding-top: 16px;
        padding-bottom: 28px;
    }

    .auth-heading {
        margin-top: 0;
    }
}
