.auth-layout {
    min-height: calc(100vh - 240px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
}

.auth-page-container {
    width: 100%;
    max-width: 460px;
}

.auth-page {
    width: 100%;
}

.auth-card {
    background: linear-gradient(160deg, #1c1c1c 0%, #141414 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
    padding: 28px 24px;
}

.auth-title {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--primary-white);
}

.auth-subtitle {
    color: var(--accent-white);
    margin-bottom: 24px;
    font-size: 15px;
}

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

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

.auth-field label {
    color: var(--secondary-white);
    font-size: 14px;
    font-weight: 600;
}

.auth-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--secondary-black);
    color: var(--primary-white);
    padding: 12px 14px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input::placeholder {
    color: #8f8f8f;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.auth-password-wrap {
    position: relative;
    width: 100%;
}

.auth-password-wrap .auth-input {
    padding-right: 42px;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #aeb4be;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.auth-password-toggle:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.auth-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.auth-submit-btn {
    margin-top: 4px;
}

.auth-submit-btn.is-muted,
.auth-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(35%);
    pointer-events: none;
}

.auth-feedback {
    min-height: 24px;
    margin: 16px 0 4px;
    font-size: 14px;
    line-height: 1.3;
}

.auth-feedback.is-error {
    color: #ff837c;
}

.auth-feedback.is-success {
    color: #88d98c;
}

.auth-switch-text {
    color: var(--accent-white);
    font-size: 14px;
}

.auth-link-btn {
    background: none;
    border: 0;
    color: var(--primary-white);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.auth-userbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    background-color: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
}

.auth-userbar-text {
    color: var(--secondary-white);
    font-size: 14px;
    word-break: break-all;
}

.auth-logout-btn {
    flex: 0 0 auto;
    min-width: 112px;
    padding: 8px 14px;
    font-size: 14px;
}

:root[data-theme="light"] .auth-card {
    background: linear-gradient(160deg, #ffffff 0%, #f6f9ff 100%);
    box-shadow: 0 14px 30px rgba(15, 24, 42, 0.14);
}

:root[data-theme="light"] .auth-input::placeholder {
    color: #78849b;
}

:root[data-theme="light"] .auth-input:focus {
    border-color: rgba(45, 91, 178, 0.55);
    box-shadow: 0 0 0 3px rgba(45, 91, 178, 0.18);
}

:root[data-theme="light"] .auth-password-toggle {
    color: #66728a;
}

:root[data-theme="light"] .auth-password-toggle:hover {
    color: #2e3d57;
    background-color: rgba(31, 49, 83, 0.08);
}

:root[data-theme="light"] .auth-password-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(45, 91, 178, 0.25);
}

@media (max-width: 768px) {
    .auth-layout {
        min-height: auto;
        padding: 12px 0;
    }

    .auth-card {
        border-radius: 12px;
        padding: 22px 16px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-userbar {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-logout-btn {
        width: 100%;
    }
}
