:root {
    --auth-radius-sm: 6px;
    --auth-radius-md: 10px;
    --auth-radius-lg: 16px;
    --auth-radius-xl: 24px;
    --auth-primary: #4f7cff;
    --auth-primary-hover: #3d6ae8;
    --auth-accent: #69be28;
    --auth-text: #1e293b;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-bg-input: #f8fafc;
    --auth-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    --auth-shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
}

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: url(../img/login-bg.jpg) center / cover no-repeat;
    overflow: hidden;
}

.auth-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.72) 0%,
        rgba(30, 58, 95, 0.55) 50%,
        rgba(15, 23, 42, 0.65) 100%
    );
    backdrop-filter: blur(2px);
}

.auth-page__container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow);
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    animation: authFadeIn 0.45s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card__header {
    padding: 2rem 2rem 0.5rem;
    text-align: center;
}

.auth-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    border-radius: var(--auth-radius-md);
    background: linear-gradient(135deg, var(--auth-primary) 0%, #6366f1 100%);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: var(--auth-shadow-sm);
}

.auth-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--auth-text);
    letter-spacing: -0.02em;
}

.auth-card__subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.auth-card__body {
    padding: 1.5rem 2rem 2rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-text);
    text-transform: none;
    letter-spacing: 0;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--auth-text);
    background: var(--auth-bg-input);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input:hover {
    border-color: #cbd5e1;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.15);
}

.auth-field.errorvalidator .auth-input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper .auth-input {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: var(--auth-radius-sm);
    background: transparent;
    color: var(--auth-text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.auth-password-toggle:hover {
    color: var(--auth-primary);
    background: rgba(79, 124, 255, 0.08);
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.8125rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary) 0%, #6366f1 100%);
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 14px rgba(79, 124, 255, 0.35);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 124, 255, 0.4);
    color: #fff;
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-transform: none;
    cursor: pointer;
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--auth-primary);
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
}

.auth-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: none;
}

.auth-back-link {
    display: block;
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-back-link:hover {
    color: var(--auth-primary);
    text-decoration: none;
}

/* Modal */
.auth-modal .modal-dialog {
    max-width: 400px;
    margin: 1.75rem auto;
}

.auth-modal .modal-content {
    border: none;
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

.auth-modal .modal-header {
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: none;
}

.auth-modal .modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-modal .modal-header .close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
    font-size: 1.5rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.auth-modal .modal-header .close:hover {
    opacity: 1;
}

.auth-modal .modal-body {
    padding: 0.5rem 1.5rem 1.5rem;
}

/* Toastr overrides on auth pages */
.auth-page ~ #toast-container .toast,
body:has(.auth-page) #toast-container .toast {
    border-radius: var(--auth-radius-md) !important;
    box-shadow: var(--auth-shadow-sm) !important;
    opacity: 1 !important;
}

@media (max-width: 480px) {
    .auth-card__header,
    .auth-card__body {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .auth-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

.auth-modal.modal {
    display: none;
}

.auth-modal.modal.show {
    display: block;
}
