:root {
    color-scheme: light;
    --auth-ink: #0e1726;
    --auth-muted: #657184;
    --auth-deep: #012f2e;
    --auth-deep-2: #064c45;
    --auth-teal: #0f8f6d;
    --auth-green: #2bd982;
    --auth-green-soft: #eafff2;
    --auth-line: #dfe8e6;
    --auth-surface: #ffffff;
    --auth-page: #f5faf8;
    --auth-danger: #991b1b;
    --auth-danger-soft: #fef2f2;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
    background:
        linear-gradient(140deg, rgba(1, 47, 46, 0.98) 0%, rgba(4, 76, 69, 0.96) 44%, rgba(7, 93, 87, 0.92) 100%),
        var(--auth-deep);
    color: var(--auth-ink);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 34%),
        repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 18px);
    mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 88%, transparent 100%);
}

a {
    color: inherit;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(1120px, calc(100% - 40px));
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(18px, 3vh, 34px) 0;
}

.auth-top-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
}

.auth-top-link::before {
    content: "<";
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-top-link:hover,
.auth-top-link:focus-visible {
    color: #ffffff;
}

.auth-panel {
    display: grid;
    grid-template-columns: minmax(390px, 0.92fr) minmax(400px, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1.8rem;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(16px);
}

.auth-copy {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: min(640px, calc(100svh - 170px));
    padding: clamp(2rem, 4.5vw, 3.6rem);
    color: #ffffff;
    background:
        linear-gradient(160deg, rgba(2, 47, 43, 0.88) 0%, rgba(0, 94, 82, 0.66) 100%);
}

.auth-copy::after {
    content: "";
    position: absolute;
    right: -12%;
    bottom: 0;
    width: 52%;
    height: 68%;
    background: repeating-linear-gradient(122deg, rgba(103, 244, 161, 0.12) 0 1px, transparent 1px 16px);
    opacity: 0.5;
    transform: skewX(-10deg);
}

.auth-logo {
    position: relative;
    z-index: 1;
    width: 4.4rem;
    height: 4.4rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #64f394, #11b982);
    object-fit: cover;
    box-shadow: 0 1rem 2.2rem rgba(0, 0, 0, 0.24);
}

.auth-badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 1.15rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(103, 244, 161, 0.28);
    border-radius: 999px;
    color: #c9ffdb;
    background: rgba(39, 216, 130, 0.11);
    font-size: 0.78rem;
    font-weight: 900;
}

.auth-copy h1 {
    position: relative;
    z-index: 1;
    max-width: 14ch;
    margin: 0 0 0.85rem;
    color: #ffffff;
    font-size: clamp(2.1rem, 4.1vw, 3.85rem);
    line-height: 0.98;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.auth-copy p {
    position: relative;
    z-index: 1;
    max-width: 35rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.02rem;
}

.auth-benefits {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.7rem;
    margin: 1.65rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-benefits li {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    font-weight: 750;
}

.auth-benefits li::before {
    content: "\2713";
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    color: #053a33;
    background: linear-gradient(135deg, #7bffa0 0%, #25d58f 100%);
    font-size: 0.85rem;
    font-weight: 950;
}

.auth-form-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    margin: 0.55rem;
    padding: clamp(2rem, 4.2vw, 3.4rem);
    border-radius: 1.45rem;
    background: var(--auth-surface);
    box-shadow: 0 1.5rem 3.8rem rgba(1, 47, 46, 0.18);
}

.auth-kicker {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 0.85rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: var(--auth-green-soft);
    color: #087354;
    font-size: 0.76rem;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.auth-form-wrap h2 {
    margin: 0 0 0.45rem;
    color: var(--auth-ink);
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.auth-subtitle {
    max-width: 32rem;
    margin: 0 0 1.5rem;
    color: var(--auth-muted);
    font-size: 0.98rem;
}

.auth-form {
    display: grid;
    gap: 0.9rem;
}

.auth-field {
    display: grid;
    gap: 0.42rem;
}

.auth-field label,
.auth-check {
    color: #263244;
    font-size: 0.92rem;
    font-weight: 800;
}

.auth-field input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--auth-line);
    border-radius: 0.95rem;
    background: #fbfefd;
    color: #101827;
    font: inherit;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.auth-field input:focus {
    border-color: rgba(21, 190, 126, 0.9);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(43, 217, 130, 0.14);
}

.auth-check {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    color: #4c5a6d;
    font-weight: 600;
    line-height: 1.45;
}

.auth-check input {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.2rem;
    accent-color: var(--auth-teal);
}

.auth-check a,
.auth-switch a {
    color: #087354;
    font-weight: 900;
    text-decoration: none;
}

.auth-check a:hover,
.auth-switch a:hover {
    text-decoration: underline;
}

.auth-button,
.auth-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.35rem;
    padding: 0.85rem 1rem;
    border-radius: 0.95rem;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 950;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.auth-button {
    margin-top: 0.2rem;
    color: #072a24;
    background: linear-gradient(135deg, #70f493 0%, #18c987 100%);
    box-shadow: 0 1rem 1.8rem rgba(24, 201, 135, 0.26);
}

.auth-button:hover:not(:disabled),
.auth-button:focus-visible:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 1.2rem 2.1rem rgba(24, 201, 135, 0.32);
}

.auth-button:disabled,
.auth-google:disabled {
    cursor: progress;
    opacity: 0.72;
}

.auth-google {
    margin-top: 0.8rem;
    color: var(--auth-ink);
    background: #ffffff;
    border-color: var(--auth-line);
}

.auth-google::before {
    content: "G";
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.55rem;
    border-radius: 50%;
    color: #0f8f6d;
    background: #f2fbf7;
    font-weight: 950;
}

.auth-google:hover:not(:disabled),
.auth-google:focus-visible:not(:disabled) {
    border-color: rgba(15, 143, 109, 0.42);
    background: #f8fffb;
    transform: translateY(-1px);
}

.auth-switch {
    margin: 1rem 0 0;
    color: var(--auth-muted);
    text-align: center;
}

.auth-alert {
    display: none;
    margin-bottom: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.9rem;
    font-size: 0.92rem;
    font-weight: 800;
}

.auth-alert.is-visible {
    display: block;
}

.auth-alert.is-error {
    color: var(--auth-danger);
    background: var(--auth-danger-soft);
    border: 1px solid #fecaca;
}

.auth-alert.is-success {
    color: #087354;
    background: var(--auth-green-soft);
    border: 1px solid rgba(43, 217, 130, 0.32);
}

.auth-footer {
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.88rem;
    text-align: center;
}

html.rc-apk-auth body {
    min-height: 100vh;
    min-height: 100svh;
    background: linear-gradient(155deg, #012f2e 0%, #064c45 54%, #073943 100%);
}

.rc-apk-auth .auth-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    padding: 0;
}

.rc-apk-auth .auth-top-link,
.rc-apk-auth .auth-footer {
    display: none;
}

.rc-apk-auth .auth-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.rc-apk-auth .auth-copy {
    min-height: auto;
    padding: calc(env(safe-area-inset-top, 0px) + 2.1rem) 1.45rem 1.35rem;
    background: transparent;
}

.rc-apk-auth .auth-copy::after {
    right: -18%;
    bottom: 0;
    opacity: 0.75;
}

.rc-apk-auth .auth-logo {
    width: 3.9rem;
    height: 3.9rem;
    margin-bottom: 1.25rem;
    border-radius: 1.05rem;
}

.rc-apk-auth .auth-badge {
    margin-bottom: 1rem;
}

.rc-apk-auth .auth-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.35rem, 13vw, 3.45rem);
}

.rc-apk-auth .auth-copy p {
    max-width: 27rem;
    font-size: 0.98rem;
}

.rc-apk-auth .auth-benefits {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-top: 1.2rem;
}

.rc-apk-auth .auth-benefits li {
    min-height: 2.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.85rem;
    font-size: 0.88rem;
}

.rc-apk-auth .auth-form-wrap {
    margin: auto 0 0;
    padding: 1.55rem 1.35rem calc(env(safe-area-inset-bottom, 0px) + 1.35rem);
    border-radius: 1.7rem 1.7rem 0 0;
    box-shadow: 0 -1.2rem 3rem rgba(0, 0, 0, 0.22);
}

.rc-apk-auth .auth-form-wrap h2 {
    font-size: 1.75rem;
}

.rc-apk-auth .auth-subtitle {
    margin-bottom: 1.1rem;
    font-size: 0.94rem;
}

@media (max-width: 900px) {
    .auth-shell {
        justify-content: flex-start;
        padding: 1.1rem 0 2rem;
    }

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

    .auth-copy {
        min-height: auto;
        padding: 2rem;
    }

    .auth-copy h1 {
        max-width: 15ch;
    }

    .auth-form-wrap {
        margin: 0;
        border-radius: 0 0 1.5rem 1.5rem;
        padding: 2rem;
    }
}

@media (max-width: 520px) {
    .auth-shell {
        width: min(100% - 1.5rem, 1120px);
        padding: 0.9rem 0 1.5rem;
    }

    .auth-top-link {
        margin-bottom: 0.75rem;
        font-size: 0.9rem;
    }

    .auth-panel {
        border-radius: 1.25rem;
    }

    .auth-copy,
    .auth-form-wrap {
        padding: 1.45rem 1.25rem;
    }

    .auth-logo {
        width: 3.7rem;
        height: 3.7rem;
        margin-bottom: 1.1rem;
    }

    .auth-copy h1 {
        font-size: clamp(2rem, 11vw, 2.75rem);
    }

    .auth-benefits li {
        font-size: 0.9rem;
    }

    .auth-form-wrap h2 {
        font-size: clamp(1.6rem, 8vw, 2rem);
    }
}
