/*
 * auth.css
 * --------
 * Styles for the standalone authentication pages:
 *   - login.html
 *   - register.html
 *   - change_password.html
 *
 * Extracted from inline <style> blocks 2026-03-28.
 */

/* ================================================================
   Shared Auth Styles
   ================================================================ */

/* Override main layout for auth pages — scoped to prevent global leakage */
body.ldr-login-page,
body.ldr-register-page,
body.ldr-change-password-page {
    min-height: 100vh;
    background: var(--bg-primary);
    margin: 0;
    padding: 0;
}

body.ldr-login-page .ldr-card,
body.ldr-register-page .ldr-card,
body.ldr-change-password-page .ldr-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

body.ldr-login-page .alert,
body.ldr-register-page .alert,
body.ldr-change-password-page .alert {
    background: rgba(var(--error-color-rgb), 0.1);
    border: 1px solid rgba(var(--error-color-rgb), 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--error-color);
    position: relative;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .alert-success {
    background: rgba(var(--success-color-rgb), 0.1);
    border-color: rgba(var(--success-color-rgb), 0.3);
    color: var(--success-color);
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .alert-info {
    background: rgba(var(--accent-tertiary-rgb), 0.1);
    border-color: rgba(var(--accent-tertiary-rgb), 0.3);
    color: var(--accent-tertiary);
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .alert-dismissible {
    padding-right: 3rem;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    width: auto;
    height: auto;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .btn-close:hover {
    opacity: 1;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .form-group {
    margin-bottom: 1.5rem;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.ldr-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    min-height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.ldr-form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.1);
}

.ldr-form-control::placeholder {
    color: var(--text-muted);
}

.ldr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.ldr-checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.ldr-checkbox-label input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    width: 100%;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .btn:active {
    transform: translateY(0);
}

.ldr-auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.ldr-auth-links p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.ldr-auth-links a {
    color: var(--accent-tertiary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.ldr-auth-links a:hover {
    color: var(--accent-secondary);
}

.ldr-browser-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.ldr-browser-hint i {
    font-size: 1rem;
}

/* Password strength indicator (shared by register + change_password) */
.ldr-password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
}

.ldr-strength-weak  { background-color: var(--error-color);   width: 33%; }
.ldr-strength-medium { background-color: var(--warning-color); width: 66%; }
.ldr-strength-strong { background-color: var(--success-color); width: 100%; }

/* Validation styles (shared by register + change_password) */
.ldr-form-control.is-invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(var(--error-color-rgb), 0.15);
}

.ldr-form-control.is-valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(var(--success-color-rgb), 0.15);
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .form-group .ldr-error-message {
    display: none;
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .form-group .ldr-error-message.show {
    display: block;
}

/* ================================================================
   Login Page
   ================================================================ */

body.ldr-login-page {
    background-image:
        radial-gradient(ellipse at top left, rgba(var(--accent-primary-rgb), 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(var(--accent-tertiary-rgb), 0.1) 0%, transparent 50%);
    padding: 0;
    overflow-x: hidden;
}

.ldr-auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

body.ldr-login-page .ldr-auth-container {
    width: 100%;
    max-width: 450px;
}

body.ldr-login-page .ldr-auth-header {
    text-align: center;
    margin-bottom: 3rem;
}

body.ldr-login-page .ldr-auth-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

body.ldr-login-page .ldr-auth-header h1 i {
    color: var(--accent-primary);
    font-size: 1.75rem;
}

body.ldr-login-page .ldr-auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

body.ldr-login-page .ldr-card-content {
    padding: 2rem 2.5rem;
}

.ldr-encryption-banner {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.1) 0%, rgba(var(--accent-tertiary-rgb), 0.1) 100%);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.ldr-encryption-banner i {
    color: var(--accent-primary);
    font-size: 2rem;
}

.ldr-encryption-banner-content {
    flex: 1;
}

.ldr-encryption-banner-content strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ldr-encryption-banner-content span {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

.ldr-security-warning {
    background: rgba(var(--warning-color-rgb), 0.1);
    border: 1px solid rgba(var(--warning-color-rgb), 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--warning-color);
}

.ldr-security-warning i {
    margin-right: 0.5rem;
}

/* ================================================================
   Register Page
   ================================================================ */

body.ldr-register-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background-image:
        radial-gradient(ellipse at top left, rgba(var(--accent-primary-rgb), 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(var(--accent-tertiary-rgb), 0.1) 0%, transparent 50%);
}

body.ldr-register-page .ldr-auth-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
}

body.ldr-register-page .ldr-auth-header {
    text-align: center;
    margin-bottom: 4rem;
}

body.ldr-register-page .ldr-auth-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

body.ldr-register-page .ldr-auth-header h1 i {
    color: var(--accent-primary);
    font-size: 2.25rem;
}

body.ldr-register-page .ldr-auth-header p {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

body.ldr-register-page .ldr-card-content {
    padding: 3rem;
}

.ldr-warning-banner {
    background: rgba(var(--warning-color-rgb), 0.1);
    border: 1px solid rgba(var(--warning-color-rgb), 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.ldr-warning-banner i {
    color: var(--warning-color);
    font-size: 2rem;
    margin-top: 0.25rem;
}

.ldr-warning-banner-content {
    flex: 1;
}

.ldr-warning-banner-content strong {
    color: var(--warning-color);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ldr-warning-banner-content span {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.ldr-danger-alert {
    background: rgba(var(--error-color-rgb), 0.1);
    border: 1px solid rgba(var(--error-color-rgb), 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--error-color);
}

.ldr-danger-alert i {
    color: var(--error-color);
    font-size: 2rem;
    margin-right: 1rem;
}

.ldr-danger-alert strong {
    display: block;
    margin-bottom: 0.5rem;
}

body.ldr-register-page .form-group {
    margin-bottom: 2rem;
}

body.ldr-register-page .form-group label {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

body.ldr-register-page .form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

body.ldr-register-page .ldr-form-control {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 1.1rem;
}

.ldr-password-requirements {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .form-group.ldr-password-field {
    margin-bottom: 1rem;
}

.ldr-password-requirements strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.ldr-password-requirements ul {
    margin: 0;
    padding-left: 1.75rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.ldr-password-requirements li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ldr-acknowledge-box {
    background: rgba(var(--error-color-rgb), 0.05);
    border: 1px solid rgba(var(--error-color-rgb), 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

body.ldr-register-page .ldr-checkbox-label {
    align-items: flex-start;
    gap: 1rem;
    font-size: 1.05rem;
    margin-bottom: 0;
}

body.ldr-register-page .ldr-checkbox-label input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    margin-top: 0.125rem;
}

.ldr-checkbox-label span {
    line-height: 1.5;
}

.ldr-checkbox-label strong {
    color: var(--error-color);
    font-weight: 600;
}

body.ldr-register-page .btn {
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    border-radius: 10px;
    font-size: 1.15rem;
}

body.ldr-register-page .ldr-auth-links {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
}

body.ldr-register-page .ldr-auth-links p {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

body.ldr-register-page .ldr-auth-links a {
    font-size: 1.05rem;
}

.ldr-checkbox-label.is-invalid span {
    color: var(--error-color);
}

/* ================================================================
   Change Password Page
   ================================================================ */

body.ldr-change-password-page {
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ldr-change-password-container {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 450px;
}

.ldr-change-password-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ldr-change-password-header h1 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.ldr-change-password-header p {
    color: var(--text-muted);
    margin: 0;
}

:is(body.ldr-login-page, body.ldr-register-page, body.ldr-change-password-page) .form-floating {
    margin-bottom: 1rem;
}

.ldr-btn-change {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
}

.ldr-change-password-container .alert {
    margin-bottom: 1rem;
}

.ldr-warning-box {
    background-color: rgba(var(--accent-tertiary-rgb), 0.1);
    border-left: 4px solid var(--accent-tertiary);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.ldr-warning-box i {
    color: var(--accent-tertiary);
}

.ldr-process-info {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ldr-process-info ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

/* ================================================================
   Media Queries
   ================================================================ */

@media (max-width: 600px) {
    body.ldr-login-page .ldr-auth-container {
        max-width: 100%;
        padding: 0 1rem;
    }

    body.ldr-login-page .ldr-card-content {
        padding: 2rem 1.5rem !important;
    }
}
