.public-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--app-text-color);
    background: var(--app-page-background) var(--login-background-image, none) center center / cover no-repeat fixed;
}

.public-auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.public-auth-card {
    width: min(100%, 640px);
    padding: 2.25rem;
    border: 1px solid rgba(23, 50, 77, 0.08);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 60px rgba(23, 50, 77, 0.10);
    backdrop-filter: blur(10px);
}

.public-auth-brand {
    margin-bottom: 1.5rem;
    text-align: center;
}

.public-auth-brand-logo {
    width: auto;
    max-width: 210px;
    height: 52px;
    object-fit: contain;
}

.public-auth-copy {
    margin: 0 auto 1.75rem;
    max-width: 38rem;
    text-align: center;
}

.public-auth-heading {
    margin: 0;
    color: var(--app-text-color);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    line-height: 1.3;
}

.public-auth-subtitle {
    margin: 0;
    color: var(--app-text-color);
    font-size: 1.2em;
    line-height: 1.6;
}

.public-auth-alert {
    margin-bottom: 1rem;
    border-radius: 16px;
}

.public-auth-message {
    margin: 0 auto 1.75rem;
    max-width: 40rem;
    text-align: center;
}

.public-auth-message p {
    margin: 0;
    color: var(--app-text-color);
    font-size: 1rem;
    line-height: 1.7;
}

.public-auth-message p + p {
    margin-top: .9rem;
}

.public-auth-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin: 0 auto 1.25rem;
    padding: .65rem 1rem;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}

.public-auth-status-success {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.public-auth-status-error {
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
}

.public-auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.public-auth-field-full {
    grid-column: 1 / -1;
}

.public-auth-label {
    margin-bottom: .45rem;
    color: var(--app-text-color);
    font-size: .92rem;
    font-weight: 600;
}

.public-auth-input {
    min-height: 52px;
    padding: .85rem 1rem;
    border: 1px solid #d7e2ee;
    border-radius: 14px;
    background: #fdfefe;
    box-shadow: none;
}

.public-auth-input:focus {
    border-color: rgba(232, 90, 28, 0.45);
    box-shadow: 0 0 0 .2rem rgba(232, 90, 28, 0.12);
}

.public-auth-password-group {
    position: relative;
}

.public-auth-password-group .public-auth-input {
    padding-right: 3.25rem;
}

.public-auth-password-toggle {
    position: absolute;
    top: 50%;
    right: .65rem;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #587087;
    padding: 0;
}

.public-auth-password-toggle:hover,
.public-auth-password-toggle:focus {
    color: #E85A1C;
}

.public-auth-error {
    margin-top: .4rem;
    font-size: .84rem;
}

.public-auth-legal-check {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin-top: .25rem;
    padding: .9rem 1rem;
    border: 1px solid #e3ebf3;
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.72);
}

.public-auth-legal-check input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: .18rem;
    flex: 0 0 auto;
}

.public-auth-legal-check label {
    margin: 0;
    color: var(--app-text-color);
    font-size: .92rem;
    line-height: 1.55;
}

.public-auth-legal-check a,
.public-auth-privacy-note a,
.public-legal-content a {
    color: #b94712;
    font-weight: 700;
    text-decoration: none;
}

.public-auth-legal-check a:hover,
.public-auth-legal-check a:focus,
.public-auth-privacy-note a:hover,
.public-auth-privacy-note a:focus,
.public-legal-content a:hover,
.public-legal-content a:focus {
    color: #8f3309;
}

.public-auth-privacy-note {
    margin: .85rem 0 0;
    color: #5f7388;
    font-size: .9rem;
    line-height: 1.6;
}

.public-legal-shell {
    align-items: flex-start;
}

.public-legal-card {
    width: min(100%, 860px);
}

.public-legal-content {
    display: grid;
    gap: 1rem;
    color: var(--app-text-color);
    font-size: .98rem;
    line-height: 1.75;
}

.public-legal-content h2 {
    margin: .65rem 0 0;
    color: #16394f;
    font-size: 1.1rem;
    font-weight: 700;
}

.public-legal-content p {
    margin: 0;
}

.public-legal-content ul {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding-left: 1.25rem;
}

.public-legal-updated {
    color: #6b7f92;
    font-size: .9rem;
}

.public-legal-actions {
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

.public-legal-actions > .public-auth-link-btn {
    flex: 0 0 auto;
}

.public-legal-actions-links {
    flex: 1 1 auto;
    min-width: 0;
}

.public-legal-actions .public-legal-links {
    justify-content: flex-end;
    gap: .5rem;
    margin-top: 0;
}

.public-legal-actions .public-legal-links span {
    display: none;
}

.public-legal-actions .public-legal-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: .6rem .9rem;
    border: 1px solid #d7e2ee;
    border-radius: 999px;
    background: #fff;
    color: #16394f;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
}

.public-legal-actions .public-legal-links a:hover,
.public-legal-actions .public-legal-links a:focus {
    border-color: rgba(232, 90, 28, 0.34);
    background: #fff3ed;
    color: #b94712;
}

.public-legal-actions .public-legal-links a.is-active {
    border-color: #b94712;
    background: #b94712;
    color: #fff;
}

.public-auth-actions {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.public-auth-link-btn,
.public-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 14px;
    padding: .8rem 1.25rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: none;
}

.public-auth-link-btn {
    border: 1px solid #d7e2ee;
    background: #fff;
    color: var(--app-text-color);
}

.public-auth-link-btn:hover,
.public-auth-link-btn:focus {
    border-color: #c9d7e4;
    background: #fff;
    color: var(--app-text-color);
    box-shadow: none;
}

.public-auth-submit {
    --bs-btn-color: #fff;
    --bs-btn-bg: #B94712;
    --bs-btn-border-color: #B94712;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #A53D0D;
    --bs-btn-hover-border-color: #A53D0D;
    --bs-btn-focus-shadow-rgb: 185, 71, 18;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #8F3309;
    --bs-btn-active-border-color: #8F3309;
    border: 0;
    background: #B94712;
    color: #fff;
}

.public-auth-submit:hover,
.public-auth-submit:focus,
.public-auth-submit:focus-visible,
.public-auth-submit:active,
.public-auth-submit.active,
.btn-check:checked + .public-auth-submit {
    background: #A53D0D;
    border-color: #A53D0D;
    color: #fff;
    box-shadow: none;
}

@media (max-width: 575.98px) {
    .public-auth-shell {
        align-items: flex-start;
        padding: max(1rem, env(safe-area-inset-top)) 1rem calc(1.75rem + env(safe-area-inset-bottom));
    }

    .public-auth-card {
        padding: 1.5rem 1.15rem;
        border-radius: 22px;
    }

    .public-auth-brand-logo {
        max-width: 180px;
        height: 44px;
    }

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

    .public-auth-actions {
        flex-direction: column-reverse;
    }

    .public-legal-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .public-legal-actions .public-legal-links {
        justify-content: center;
    }

    .public-auth-link-btn,
    .public-auth-submit {
        width: 100%;
    }

    .public-auth-page {
        background-attachment: scroll;
    }
}

@media (max-height: 700px) and (max-width: 575.98px) {
    .public-auth-brand {
        margin-bottom: 1rem;
    }

    .public-auth-copy {
        margin-bottom: 1.2rem;
    }

    .public-auth-card {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }
}
