.auth-page {
    min-height: 100vh;
}

.auth-stage {
    min-height: 100vh;
    padding: 116px clamp(18px, 5vw, 70px) 42px;
    display: grid;
    grid-template-columns: minmax(360px, .95fr) minmax(380px, 520px);
    gap: clamp(30px, 6vw, 90px);
    align-items: center;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.auth-brand {
    display: grid;
    place-items: center;
}

.auth-wordmark {
    white-space: nowrap;
    font-size: clamp(72px, 9vw, 142px);
    line-height: .92;
    letter-spacing: -.035em;
    font-weight: 920;
    color: var(--paper);
    text-shadow: 0 24px 80px rgba(202, 255, 61, .14);
    animation: rise .76s ease both;
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 3vw, 34px);
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045)),
        color-mix(in srgb, var(--ink) 70%, transparent);
    border: 1px solid var(--line);
    box-shadow: 0 34px 110px var(--shadow);
    backdrop-filter: blur(24px);
    animation: rise .76s ease .08s both;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    background: radial-gradient(circle at 18% 0%, rgba(202, 255, 61, .28), transparent 34%);
}

.auth-title {
    font-size: clamp(30px, 3.6vw, 48px);
    line-height: .95;
    letter-spacing: -.055em;
    font-weight: 950;
    margin-bottom: 22px;
}

.provider-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.provider-btn,
.submit-btn,
.mini-btn {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid var(--line);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.provider-btn {
    min-height: 48px;
    display: grid;
    place-items: center;
    color: var(--paper);
    background: rgba(255, 255, 255, .055);
    font-weight: 880;
}

.provider-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(202, 255, 61, .56);
    box-shadow: 0 16px 46px rgba(202, 255, 61, .12);
}

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

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

.auth-form label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.auth-form input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .07);
    color: var(--paper);
    outline: none;
    font-size: 16px;
    font-weight: 720;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-form input:focus {
    border-color: rgba(202, 255, 61, .72);
    box-shadow: 0 0 0 4px rgba(202, 255, 61, .10);
    background: rgba(255, 255, 255, .10);
}

.captcha-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 8px 8px 8px 16px;
    border-radius: 18px;
    background: rgba(202, 255, 61, .08);
    border: 1px solid rgba(202, 255, 61, .22);
}

.captcha-line strong {
    color: var(--paper);
    font-size: 16px;
    letter-spacing: -.02em;
}

.mini-btn {
    min-height: 34px;
    padding: 7px 12px;
    color: #111506;
    background: linear-gradient(135deg, var(--lime), var(--lime-soft));
    font-size: 12px;
    font-weight: 850;
}

.submit-btn {
    min-height: 54px;
    padding: 0 18px;
    color: #111506;
    background: linear-gradient(135deg, var(--lime), var(--lime-soft));
    border-color: rgba(202, 255, 61, .92);
    font-size: 16px;
    font-weight: 920;
    box-shadow: 0 18px 58px rgba(202, 255, 61, .20);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 68px rgba(202, 255, 61, .31);
}

.submit-btn-secondary {
    box-shadow: none;
}

.reset-panel {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.reset-panel summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
    font-weight: 820;
    transition: color .2s ease;
}

.reset-panel summary:hover {
    color: var(--paper);
}

.reset-form {
    margin-top: 16px;
}

.auth-message {
    min-height: 20px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.auth-message.is-error {
    color: #ffb4b4;
}

.auth-message.is-ok {
    color: var(--lime);
}

.dashboard-card {
    display: grid;
    gap: 14px;
}

.dashboard-line {
    color: var(--paper);
    font-size: 18px;
    font-weight: 800;
}

.muted-line {
    color: var(--muted);
    font-size: 14px;
}

body[data-theme="light"] .auth-form input {
    background: rgba(255, 255, 255, .72);
}

body[data-theme="light"] .provider-btn {
    background: rgba(255, 255, 255, .72);
}

@media (max-width: 860px) {
    .auth-stage {
        grid-template-columns: 1fr;
        padding-top: 106px;
    }

    .auth-wordmark {
        font-size: clamp(56px, 17vw, 94px);
    }
}

@media (max-width: 540px) {
    .provider-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        border-radius: 26px;
    }
}

/* Login page refinement */
.auth-stage {
    align-items: center;
    overflow: visible;
}

.auth-brand {
    justify-self: start;
    align-self: center;
    place-items: start;
    transform: translate(-72px, -44px);
    max-width: none;
    overflow: visible;
}

.auth-wordmark {
    max-width: none;
    overflow: visible;
    font-size: clamp(70px, 7.4vw, 126px);
    letter-spacing: -.032em;
}

.auth-card {
    margin-top: -18px;
}

.auth-message {
    margin: -2px 0 14px;
    min-height: 22px;
}

.auth-message.is-error {
    color: #ff8f8f;
    font-weight: 760;
}

.captcha-row {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 34%);
    gap: 10px;
    align-items: center;
}

.captcha-row input {
    min-height: 48px;
}

.auth-button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 2px;
}

.submit-btn-secondary {
    color: var(--paper);
    background: rgba(255, 255, 255, .055);
    border-color: var(--line);
}

.submit-btn-secondary:hover {
    border-color: rgba(202, 255, 61, .56);
    box-shadow: 0 16px 46px rgba(202, 255, 61, .12);
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 22px;
}

.auth-modal.is-open {
    display: grid;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .48);
    backdrop-filter: blur(12px);
}

.auth-modal-card {
    position: relative;
    z-index: 2;
    width: min(480px, 100%);
    padding: clamp(24px, 4vw, 34px);
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .055)),
        color-mix(in srgb, var(--ink) 78%, transparent);
    border: 1px solid var(--line);
    box-shadow: 0 36px 120px rgba(0, 0, 0, .45);
    backdrop-filter: blur(26px);
    animation: rise .24s ease both;
}

.modal-title {
    margin-bottom: 14px;
}

.modal-copy {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.45;
    margin-bottom: 22px;
}

.modal-copy strong {
    color: var(--paper);
    word-break: break-word;
}

.modal-actions {
    margin-top: 0;
}

@media (max-width: 1060px) {
    .auth-brand {
        transform: none;
        justify-self: center;
        place-items: center;
    }

    .auth-wordmark {
        font-size: clamp(58px, 15vw, 100px);
    }
}

@media (max-width: 620px) {
    .captcha-row,
    .auth-button-row {
        grid-template-columns: 1fr;
    }
}

/* Readable form messages */
.auth-message {
    display: none;
    padding: 11px 13px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 780;
}

.auth-message:not(:empty) {
    display: block;
}

.auth-message.is-ok {
    color: #2f4200;
    background: rgba(202, 255, 61, .36);
    border-color: rgba(136, 169, 0, .28);
}

.auth-message.is-error {
    color: #7e1111;
    background: rgba(255, 143, 143, .18);
    border-color: rgba(255, 143, 143, .36);
}

body[data-theme="dark"] .auth-message.is-ok {
    color: var(--lime);
    background: rgba(202, 255, 61, .10);
    border-color: rgba(202, 255, 61, .24);
}

body[data-theme="dark"] .auth-message.is-error {
    color: #ffb2b2;
    background: rgba(255, 143, 143, .10);
    border-color: rgba(255, 143, 143, .26);
}

.submit-btn:disabled,
.mini-btn:disabled {
    cursor: not-allowed;
    opacity: .46;
    filter: grayscale(.35);
    transform: none !important;
    box-shadow: none !important;
}

.oauth-complete-stage {
    grid-template-columns: minmax(360px, .95fr) minmax(360px, 460px);
}

.oauth-complete-card {
    display: grid;
    gap: 14px;
}

.oauth-dashboard-link {
    display: grid;
    place-items: center;
    text-decoration: none;
    margin-top: 6px;
}

/* Branded OAuth buttons */
.provider-grid {
    gap: 14px;
}

.provider-btn {
    isolation: isolate;
    min-height: 56px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    place-items: center;
    gap: 12px;
    padding: 0 16px;
    border-radius: 18px;
    font-weight: 880;
    letter-spacing: -.018em;
}

.provider-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .10);
}

.provider-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.provider-text {
    color: inherit;
    white-space: nowrap;
}

.provider-google {
    color: #111506;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, #4285F4, #34A853, #FBBC05, #EA4335) border-box;
    border: 1px solid transparent;
    box-shadow: 0 18px 54px rgba(66, 133, 244, .10);
}

.provider-google::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background:
        radial-gradient(circle at 18% 18%, rgba(66, 133, 244, .22), transparent 30%),
        radial-gradient(circle at 78% 18%, rgba(234, 67, 53, .20), transparent 30%),
        radial-gradient(circle at 20% 82%, rgba(251, 188, 5, .22), transparent 30%),
        radial-gradient(circle at 82% 82%, rgba(52, 168, 83, .20), transparent 30%);
    opacity: .55;
    transition: opacity .22s ease, transform .22s ease;
}

.provider-google:hover {
    border-color: transparent;
    box-shadow:
        0 22px 70px rgba(66, 133, 244, .16),
        0 0 0 4px rgba(202, 255, 61, .10);
}

.provider-google:hover::before {
    opacity: .95;
    transform: scale(1.03);
}

.provider-apple {
    color: var(--paper);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .045)),
        color-mix(in srgb, var(--ink) 84%, #000 16%);
    border-color: color-mix(in srgb, var(--paper) 16%, transparent);
    box-shadow: 0 18px 54px rgba(0, 0, 0, .16);
}

.provider-apple .provider-icon {
    color: #000000;
}

.provider-apple::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, .22), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, .12), transparent 46%, rgba(202, 255, 61, .12));
    opacity: .72;
    transition: opacity .22s ease, transform .22s ease;
}

.provider-apple:hover {
    border-color: rgba(202, 255, 61, .44);
    box-shadow:
        0 24px 72px rgba(0, 0, 0, .22),
        0 0 0 4px rgba(202, 255, 61, .08);
}

.provider-apple:hover::before {
    opacity: 1;
    transform: scale(1.03);
}

body[data-theme="light"] .provider-apple {
    color: #050605;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(245, 247, 235, .86)),
        #ffffff;
    border-color: rgba(0, 0, 0, .12);
}

body[data-theme="light"] .provider-google {
    box-shadow: 0 18px 54px rgba(66, 133, 244, .08);
}

@media (max-width: 540px) {
    .provider-btn {
        min-height: 54px;
        padding: 0 14px;
    }

    .provider-text {
        white-space: normal;
    }
}

/* OAuth button width and readability refinement */
.auth-stage {
    grid-template-columns: minmax(360px, .9fr) minmax(520px, 620px);
}

.auth-card {
    width: min(620px, 100%);
}

.provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.provider-btn {
    min-width: 0;
    min-height: 58px;
    padding: 0 18px;
    gap: 12px;
    font-size: 15px;
    font-weight: 720;
    letter-spacing: -.01em;
}

.provider-text {
    min-width: 0;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
    font-weight: 720;
}

.provider-icon {
    flex: 0 0 auto;
    width: 31px;
    height: 31px;
}

.provider-icon svg {
    width: 18px;
    height: 18px;
}

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

    .auth-card {
        justify-self: center;
    }
}

@media (max-width: 620px) {
    .provider-grid {
        grid-template-columns: 1fr;
    }

    .provider-btn {
        justify-content: center;
    }
}

/* OAuth loading screen */
.oauth-loading-page {
    display: grid;
    place-items: center;
}

.oauth-loader {
    position: relative;
    width: 126px;
    height: 126px;
    display: grid;
    place-items: center;
}

.oauth-loader img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 18px;
    filter: drop-shadow(0 18px 38px rgba(0, 0, 0, .26));
    animation: oauthPulse 1.2s ease-in-out infinite;
}

.oauth-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--paper) 10%, transparent);
    border-top-color: var(--lime);
    border-right-color: rgba(202, 255, 61, .55);
    animation: oauthSpin .75s linear infinite;
    box-shadow: 0 0 52px rgba(202, 255, 61, .22);
}

@keyframes oauthSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes oauthPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.045);
    }
}
