.login-page,
.login-page *,
.global-footer,
.global-footer * {
    box-sizing: border-box;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff5f3;
    color: var(--text-main);
    font-family: var(--font-family);
    --login-footer-height: 3rem;
}

.login-page {
    display: grid;
    grid-template-columns: minmax(0, 56%) minmax(27rem, 44%);
    width: 100%;
    flex: 1 0 auto;
    min-height: calc(100vh - var(--login-footer-height));
    min-height: calc(100dvh - var(--login-footer-height));
    position: relative;
}

.left-panel {
    position: relative;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    background: transparent;
}

.login-visual {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center center;
    border-radius: 0;
}

.input-icon svg,
.password-toggle svg,
.login-submit-icon svg,
.footer-meta svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.right-panel {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 4.5rem 2rem 3.5rem;
    background:
        radial-gradient(circle at top right, rgba(231, 33, 33, 0.12), transparent 35%),
        #fff7f5;
    overflow: hidden;
}

.wave {
    position: absolute;
    inset: 0;
    background: repeating-radial-gradient(circle at 78% 18%, rgba(220, 0, 0, 0.12) 0 1px, transparent 1px 0.5rem);
    opacity: 0.5;
    animation: drift 10s linear infinite;
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(100%, 28.75rem);
    margin: 0;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 1.625rem;
    padding: 3.625rem 2rem 1.75rem;
    box-shadow: 0 1.75rem 4.375rem rgba(120, 20, 20, 0.18);
    border: 1px solid rgba(220, 0, 0, 0.08);
    animation: cardIn 0.8s ease both;
}

.badge {
    position: absolute;
    top: -2.125rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #e11b22, #ff3a3a);
    border: 6px solid #fff;
    display: grid;
    place-items: center;
    color: #ffd84d;
    font-size: calc(var(--font-size-heading-lg) + 0.125rem);
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0.75rem 1.5625rem rgba(200, 0, 0, 0.25);
}

.badge svg {
    width: 2rem;
    height: 2rem;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.4;
}

.login-header {
    text-align: center;
    margin-bottom: 2.1rem;
}

.login-header h5 {
    margin: 0 0 0.5rem;
    font-size: var(--font-size-title-sm);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--text-main);
}

.login-header h2 {
    margin: 0 0 0.625rem;
    color: #c91319;
    font-size: var(--font-size-heading-lg);
    font-weight: 800;
}

.register {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--font-size-body);
}

.card-links span {
    color: #d71920;
    font-weight: 700;
    text-decoration: none;
}

.card-links .card-link-separator {
    color: var(--text-muted);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.625rem;
    border-radius: 0.8125rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #c91319;
    font-size: var(--font-size-body);
    font-weight: 700;
}

.login-error.hidden {
    display: none;
}

.login-error-icon {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    line-height: 1;
    flex-shrink: 0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5625rem;
    font-weight: 800;
    color: var(--text-main);
    font-size: var(--font-size-body);
}

.login-card-bottom {
    display: flex;
    flex-direction: column;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.2rem 0 1.35rem;
    font-size: var(--font-size-body);
}

.remember-username {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
}

.remember-username input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: #d71920;
    flex-shrink: 0;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 3.25rem;
    padding: 0 1rem;
    border: 1px solid #ddd;
    border-radius: 0.8125rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
    border-color: #e11b22;
    box-shadow: 0 0 0 0.25rem rgba(225, 27, 34, 0.09);
}

.input-icon {
    width: 1.125rem;
    min-width: 1.125rem;
    color: #d71920;
    flex-shrink: 0;
    line-height: 1;
    text-align: center;
}

.input-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    stroke-width: 2.25;
}

.input-wrap input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: none;
    color: var(--text-main);
    background: transparent;
    font: inherit;
    font-size: var(--font-size-body);
}

.input-wrap input::placeholder {
    color: var(--text-placeholder);
}

.password-toggle {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--font-size-title-sm);
    line-height: 1;
    flex-shrink: 0;
}

.password-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: #d71920;
    background: #fff3f1;
    outline: none;
}

.login-btn {
    width: 100%;
    height: 3.5rem;
    border: 0;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: linear-gradient(135deg, #d71920, #ef2b2b);
    color: #fff;
    font-size: var(--font-size-title-sm);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0.75rem 1.5rem rgba(215, 25, 32, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-0.125rem);
    box-shadow: 0 1rem 2rem rgba(215, 25, 32, 0.36);
}

.login-btn:disabled {
    cursor: wait;
    opacity: 0.82;
}

.login-submit-icon {
    line-height: 1;
}

.login-submit-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    stroke-width: 2.6;
}

.login-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: loginSpin 1s linear infinite;
    display: inline-block;
}

.card-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: var(--font-size-caption);
}

.global-footer {
    flex: 0 0 auto;
    min-height: 3rem;
    background: rgba(255, 255, 255, 0.78);
    border-top: 1px solid #f0cccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.45rem 2rem;
    z-index: 5;
    font-size: var(--font-size-body);
    color: var(--text-main);
}

.footer-copyright {
    font-weight: 700;
    white-space: nowrap;
}

.footer-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.875rem;
    flex-wrap: wrap;
}

.footer-item,
.footer-policy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.footer-meta svg {
    width: 0.95rem;
    height: 0.95rem;
    stroke-width: 2.2;
}

.footer-policy {
    color: #d71920;
    font-weight: 700;
}

.footer-separator {
    color: var(--text-muted);
    white-space: nowrap;
}

@keyframes drift {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-2.5rem);
    }
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(1.5rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 1000px) {
    .login-page {
        flex: 1 1 0;
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .left-panel {
        display: none;
    }

    .right-panel {
        height: 100%;
        min-height: 0;
        padding: 4.75rem 1rem 2rem;
        overflow: visible;
    }

    .login-card {
        width: min(100%, 28.75rem);
    }

    .global-footer {
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .footer-copyright {
        white-space: normal;
    }

    .footer-meta {
        justify-content: center;
    }
}

@media (max-height: 820px) and (min-width: 1001px) {
    .right-panel {
        padding-top: 3.75rem;
        padding-bottom: 2.25rem;
    }

    .login-card {
        padding-top: 3.25rem;
        padding-bottom: 1.5rem;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .form-group {
        margin-bottom: 0.95rem;
    }

    .input-wrap {
        height: 3rem;
    }

    .login-options {
        margin-bottom: 1rem;
    }

    .card-links {
        margin-top: 1.25rem;
    }
}

@media (max-height: 720px) and (min-width: 1001px) {
    body {
        --login-footer-height: 2.5rem;
    }

    .right-panel {
        padding: 2rem 1.5rem 1.25rem;
    }

    .login-card {
        width: min(100%, 27rem);
        padding: 2.75rem 1.5rem 1rem;
        border-radius: 1.25rem;
    }

    .badge {
        top: -1.5rem;
        width: 3.5rem;
        height: 3.5rem;
        border-width: 5px;
    }

    .badge svg {
        width: 1.55rem;
        height: 1.55rem;
    }

    .login-header {
        margin-bottom: 1rem;
    }

    .login-header h5,
    .login-header h2 {
        margin-bottom: 0.35rem;
    }

    .form-group {
        margin-bottom: 0.7rem;
    }

    .form-group label {
        margin-bottom: 0.35rem;
    }

    .input-wrap {
        height: 2.75rem;
        padding-right: 0.85rem;
        padding-left: 0.85rem;
    }

    .login-options {
        margin-bottom: 0.75rem;
    }

    .login-btn {
        height: 3rem;
    }

    .card-links {
        margin-top: 0.75rem;
    }

    .global-footer {
        min-height: var(--login-footer-height);
        padding: 0.25rem 1.5rem;
        font-size: var(--font-size-caption);
    }
}

@media (max-height: 640px) and (min-width: 1001px) {
    .card-links,
    .global-footer {
        font-size: var(--font-size-caption);
    }

    .right-panel {
        padding-top: 1.5rem;
        padding-bottom: 0.875rem;
    }

    .login-card {
        padding-top: 2.35rem;
        padding-right: 1.75rem;
        padding-bottom: 0.875rem;
        padding-left: 1.75rem;
    }

    .badge {
        top: -1.25rem;
        width: 3rem;
        height: 3rem;
        border-width: 4px;
    }

    .badge svg {
        width: 1.35rem;
        height: 1.35rem;
    }

    .login-header {
        margin-bottom: 0.75rem;
    }

    .input-wrap {
        height: 2.55rem;
    }

    .login-options {
        margin-bottom: 0.6rem;
    }

    .login-btn {
        height: 2.75rem;
    }

    .card-links {
        margin-top: 0.6rem;
    }

    .global-footer {
        padding-right: 1.25rem;
        padding-left: 1.25rem;
    }
}

@media (max-height: 560px) and (min-width: 1001px) {
    body {
        --login-footer-height: 2.25rem;
    }

    .card-links {
        display: none;
    }

    .right-panel {
        padding: 1rem 1.25rem 0.75rem;
    }

    .login-card {
        padding: 2rem 1.25rem 0.8rem;
    }

    .login-header {
        margin-bottom: 0.65rem;
    }

    .login-header h2 {
        font-size: var(--font-size-title-lg);
    }

    .form-group {
        margin-bottom: 0.55rem;
    }

    .form-group label {
        margin-bottom: 0.25rem;
    }

    .input-wrap {
        height: 2.4rem;
    }

    .login-options {
        margin-bottom: 0.5rem;
    }

    .login-btn {
        height: 2.55rem;
    }

    .global-footer {
        min-height: var(--login-footer-height);
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }
}

@media (max-width: 520px) {
    .right-panel {
        padding: 4rem 1rem 1.5rem;
    }

    .login-card {
        border-radius: 1.25rem;
        padding: 3.25rem 1.25rem 1.35rem;
    }

    .badge {
        top: -1.875rem;
        width: 4rem;
        height: 4rem;
        border-width: 5px;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
        margin-bottom: 1rem;
    }

    .card-links {
        flex-wrap: wrap;
        margin-top: 1.125rem;
    }

    .global-footer {
        gap: 0.45rem;
        padding-right: 1rem;
        padding-left: 1rem;
    }
}

@media (max-width: 520px) and (max-height: 760px) {
    .right-panel {
        padding: 3rem 0.875rem 0.875rem;
    }

    .login-card {
        padding: 2.75rem 1rem 1rem;
    }

    .badge {
        top: -1.5rem;
        width: 3.25rem;
        height: 3.25rem;
        border-width: 4px;
    }

    .badge svg {
        width: 1.45rem;
        height: 1.45rem;
    }

    .login-header {
        margin-bottom: 0.9rem;
    }

    .login-header h5,
    .login-header h2 {
        margin-bottom: 0.35rem;
    }

    .form-group {
        margin-bottom: 0.65rem;
    }

    .form-group label {
        margin-bottom: 0.3rem;
    }

    .input-wrap {
        height: 2.6rem;
        padding-right: 0.85rem;
        padding-left: 0.85rem;
    }

    .login-options {
        margin-bottom: 0.65rem;
    }

    .login-btn {
        height: 2.75rem;
    }

    .card-links {
        display: none;
    }

    .global-footer {
        gap: 0.35rem;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
        font-size: var(--font-size-caption);
    }

    .footer-meta {
        gap: 0.5rem;
    }
}
