/* Auth pages styles (login/register) */

.auth-page {
    min-height: calc(100vh - 6rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-color);
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, rgba(118, 185, 0, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(118, 185, 0, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
}

.login-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-header p {
    margin: 0 0 2rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.login-form {
    display: block;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-focus);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder,
.form-group input[type="email"]::placeholder {
    color: var(--text-muted);
}

/* Password Input Wrapper for Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    padding-right: 2.75rem;
}

.btn-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 1;
}

.btn-toggle-password:hover {
    color: var(--primary-color, #84cc16);
}

.btn-toggle-password:focus {
    outline: 2px solid var(--primary-color, #84cc16);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn-toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Primary button in auth forms: dynamic (fills available width) */
.btn-primary {
    background: var(--primary-color);
    color: var(--primary-text-on);
    border: none;
    cursor: pointer;
}

/* When used as block inside forms, stretch to available width */
.login-card .btn-block {
    display: flex;
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(var(--primary-rgba), 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card .btn-block:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgba), 0.3);
    background: var(--primary-hover);
}

.login-card .btn-block:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alert-error {
    background: var(--danger-color);
    color: var(--primary-text-on);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid #dc2626;
}

.login-footer {
    margin-top: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.login-footer .forgot-password-link {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.login-footer .forgot-password-link a {
    color: var(--text-secondary);
    font-weight: 500;
}

.login-footer .forgot-password-link a:hover {
    color: var(--primary-color);
}

/* Success alert for auth forms */
.alert-success {
    background: var(--success-light);
    color: var(--success-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Modal styles used on register page */
.modal[aria-hidden="true"] {
    display: none; /* hidden by default */
}
.modal[aria-hidden="false"] {
    display: flex;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    padding: 2rem 1rem;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface-color);
    margin: 2rem auto;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-color);
    max-width: 760px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.close-modal {
    float: right;
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* No-shell layout (used for auth pages) */
.app-container.no-shell .app-header,
.app-container.no-shell .app-sidebar,
.app-container.no-shell .sidebar-overlay,
.app-container.no-shell .app-footer {
    display: none !important;
}

.app-container.no-shell {
    min-height: 100vh;
    grid-template-areas: "content";
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--surface-color) 100%);
}

.app-container.no-shell .app-content {
    margin-left: 0 !important;
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.app-container.no-shell .auth-page {
    min-height: 100vh;
    padding: 1rem 0;
}

.app-container.no-shell .login-container {
    max-width: 420px;
    width: 100%;
}

.app-container.no-shell .login-card {
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(17,24,39,0.06);
}

/* Back Button to Home */
.btn-back-home {
    position: fixed;
    top: 2rem;
    left: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-back-home:hover {
    color: var(--primary-color, #84cc16);
    border-color: var(--primary-color, #84cc16);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-back-home:active {
    transform: scale(0.98);
}

.btn-back-home svg {
    width: 16px;
    height: 16px;
}

/* Responsiveness */
@media (max-width: 768px) {
    .login-card {
        padding: 1.25rem;
    }

    .btn-back-home {
        top: 1rem;
        left: 1rem;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .btn-back-home svg {
        width: 14px;
        height: 14px;
